Show where to put the JavaScript code inside an HTML code.
The JavaScript code lies between the <script> and the </script> tags.
It will look like the following:
<html>
<body>
<script>
alert("My first message!")
</script>
</body>
</html>
Phew! Our first code. Let's analyze-it?
Understanding the code:
alert("My first message!")
Shows a window with the
My first message phrase and an OK button. Test it yourself, create a file with a .htm extension and run it.
There are three more different ways to put the JavaScript code on your page, but we will be using the method above in our tutorial.