May 26, 2012

Adding Javascript to a page


Most browsers have Javascript interpreters, which automatically converts the Javascript program.
You must include the <script> tag in the HTML, to denote it is a javascript program.
Example:
<head>
<title>My Web Page</title>
<script type = "text/javascript">
//Your code here
</script>
</head>

text/javascript - it means, the code is in text and the script is javascript.
You can add the <script> tag, anywhere inside the HTML.

No comments:

Post a Comment