Call a function in hyperlink : a link : HTML Tags JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » HTML Tags » a link »

 

Call a function in hyperlink

















<html>
<head>
<title>Calling a Function</title>

<script language="javascript" type="text/javascript">
<!--

function greetVisitor()
{
     var myName = prompt("Name?""");
     alert("Welcome " + myName + "!")
}

//-->
</script>

</head>
<body>

<h1>Please click below and enter your name when prompted.</h1>

<P><a href="javascript:greetVisitor()">Click for a greeting</a></p>

</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo HTML Tags
» a link