JavaScript Class

Home Help Table of Contents Class Stuff

How to Put a JavaScript Into an HTML Document

Use the <script> tag to insert a JavaScript in an HTML document.

And it produces this output:

Hello World!

To insert a script in an HTML document, use the <script> tag. Use the type or language attributes to define the scripting language.

<script language="JavaScript" type="text/javascript">

Then comes the JavaScript: In JavaScript the command for writing some text on a page is document.write

document.write("Hello World!")

The script ends:

</script>







Home Help Table of Contents Class Stuff