Putting JavaScript into your page


To put javascript into your page, you need to put the script tag inside your document. Here is the form.

<script language="JavaScript">
<!--
java script statements
//-->
</script>

You may be wondering what the "<!--" and "//-->" are. This is how you make html comments. This is used for browsers which don't support javascript. What happens is the html interpreter looks at tags and responds to the tag. If, however, the browser doesn't recognize the tag, it ignores it. Then it sees the comment tag and ignores everything in it.
If the browser supports javascript, the browser recognizes what was just done and ignores the html comments tag.
The next section is Comments
Homepage JavaScript Basics Next