extension or embedded directly into the HTML on your page. Use HTML's
script tag to let the browser know how to interpret your code as shown
in the code block below. To try this out on your own, use any basic text
editor, notepad for example, to write the code. Before you start writing
the code, you need to know that:
is case sensitive and you need to put semi-colons at the end of each
- You can
add comments to the code by using double slash (//). To add multi-line
comments adding "/*" at the beginning line "*/” at the ending line.
- You should
also add comments around the script code, as shown in the code sample
code simply ignore the script and do not generate an error.
following steps to write the application:
the Notepad by clicking Start->Programs->Accessories->Notepad
following code to it:
Script tag will
tell the browser that the scripting language used is Java Script
will take a string parameter and display it on the web page
the file with .html extension
click the file. The output appears, as shown in Figure.