JavaScript is a scripting language used to make interactiveweb pages .It also known as LiveScript,
JavaScript developed by Netscape with the trademark of sunmicrosystem.
In Javascript we uses functions and the Functions can be defined in the <head> section and in the <body> section of a HTML document.
Javascript provide the following way for implement.

Code:
<html>
<head>
<script type="text/javascript">
function show()
{
alert("welcome");
}
</script>
</head>

<body>
<form>
<input type="button" value="Click " onclick="show()" >
</form>
</body>
</html>