Anchor onclick event : onClick « Event onMethod « JavaScript DHTML






Anchor onclick event

  


<html>
<head>
<title>Onclick</title>
<script type="text/javascript">
function handleclick() {
    document.write("Clicked");
    return false;
}

</script>
</head>
<body>
<p><a href="#" onclick="return handleclick();">Click Here</a></p>
</body>
</html>

   
    
  








Related examples in the same category

1.'onClick' Example
2.Put all your JavaScript statement in onclick clause
3.Running a Script from User Action
4.Add document onclick event handler