There are two ways you can javascript in to HTML.

1. Write .js file and write all the java script function and call the function from your html files.
2. You can write java script in your own HTML files itself.This is difficult to maintain if HTML file is big.

eg

<html>
<head>
<script>
function MyFunction()
{
alert("Hello World!");
}
</script>
</head>

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

the above simple example when you click the Click me buttion you will see alert of the Hello World