How To Insert Javascript into an HTML Document

I will teach you How To Insert Javascript into an HTML Document today. Javascript Tutorials and Free Javascripts

Incorporating javascript into an HTML document is simple. You merely need to place the beginning <script> and closing </script> tags within the <head> and/or the <body> tags. Within the same document, you can also use several script> tags.

How To Insert Javascript into an HTML Document



To define the scripting language, you should additionally include the type or language attribute. A known MIME type, such as "text/javascript," can be specified in the type attribute. Set the language attribute to "javascript" if you want to utilize it.

The following javascript code sample demonstrates how to include javascript in an HTML document.

<html>
<head>
<script type="text/javascript">
document.bgColor = "yellow" ;
document.write("Free Javascript Tutorial.com") ;
</script>
</head>
<body>
</body>
</html>

________________________________________________

<html>
<head>
<script type="text/javascript">
document.bgColor = "yellow" ;
document.write("Free Javascript Tutorial.com") ;
</script>
</head>
<body>
</body>
</html>

Post a Comment

0 Comments