<HTML>
<HEAD>
<TITLE>Handling onClick for links</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
function confirmLink() {
alert("This is the Java2s Home Page.")
return confirm("Are you sure you want to load this document?")
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<H1>Handling onClick for links</H1>
<P><A HREF="http://www.java2s.com" ONCLICK="return confirmLink()">
Asks you to confirm your selection of this link.</A></P>
</BODY>
</HTML>