Using onClick and onDblClick Event Handlers : Hyper Link Event « Event « JavaScript DHTML






Using onClick and onDblClick Event Handlers

<HTML>
<HEAD>
<TITLE>onClick and onDblClick Event Handlers</TITLE>
<SCRIPT LANGUAGE="JavaScript">
var msg = "";
function showClick() {
    msg = "The element has been clicked. ";
    status = msg;
}
function showDblClick() {
    msg = "The element has been double-clicked.";
    status = msg;
    return false;
}
</SCRIPT>
</HEAD>
<BODY>
<H1>onClick and onDblClick Event Handlers</H1>
<HR>
<A HREF="#" onClick="showClick();return false" 
onDblClick="return showDblClick()">
A sample link.</A>
</BODY>
</HTML>


           
       








Related examples in the same category

1.Using onMouseOver and onMouseOut Event Handlers
2.Handling onClick or Links
3.Handling onMouseOut or Links
4.Using Functions as Event Handlers
5.Using the Event Object with Navigator and Internet Explorer
6.Using the const Keyword