Call a function in hyperlink : Function Call : Function JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Function » Function Call »

 

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 Function
» Function Call