Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

onclick prevent default

function sayHello(e) {
   e.preventDefault();
   alert("hello");
}
---------------------
 <a href="#" onclick="sayHello(event);">Click to say Hello</a>
 
PREVIOUS NEXT
Tagged: #onclick #prevent #default
ADD COMMENT
Topic
Name
2+3 =