<html>
<head>
<script type="text/JavaScript">
<!--
function popup()
{
alert("Hello World")
}
//-->
</script>
</head>
<body> <input type="button" onclick="popup()" value="Click"> </body>
</html>In this code is how to write java script function from head of the html document.
