Hi can someone please explain to me what is the difference between writing
onclick="confirmLink()"
and
onclick="return confirmLink()"
I tried both and they did the same thing and I am confused since the lazy fellows from my university have given me old notes in which they randomly include the "return" sometimes and sometimes they don't in the various examples.
<html>
<head>
<title>Handling onClick for links</title>
<script>
<!--
function confirmLink()
{
alert("This is the Mastering JavaScript and JScript 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.jaworks.com/javascript" onclick="confirmLink()">Asks you
to confirm your selection of this link.</a>
</p>
</body>
</html>