You should know that java-script is not part of the HTML is a separate language. But it is embedded in the page code or it provides a link to the script file. In order to learn how to write Java-scripts, you will need a HTML editor with syntax highlighting. For example, CuteHTML is a small and very handy editor.
Usually languages start with output to screen the now-classic phrase "Hello, world!". To display this string on the browser screen, open the editor and insert after the BODY tag following code: <SCRIPT LANGUAGE="JavaScript">This line makes it clear to the browser that begins with this place of JavaScript.
Enter the second line: document.write("<FONT COLOR='RED'> Hello world!</FONT>") with this line in the browser window will display the phrase "Hello, world!". Notice this line: first, given the indication that will receive the text. Then, you specify the parameters of the text – in this case, its color. Can be added and other parameters, for example size and font type.
Complete java-script tag:</SCRIPT> This tag signals the browser that the script is complete. Now that you have entered in the editor all lines in the editor, click the browse button in the browser – View in browser (the magnifying glass on the background of the globe). In the window that opens the default browser you will see the result of your first script. Note that the browser may block its execution, it will receive a warning. Allow the browser to run Java scripts.
You can change the text size by inserting after the designation of the color ‘RED’, a space, and size=7. Experiment with the font size by changing the numbers. Adjust and color – for example, 'BLUE'.
Surely you've seen appear on the pages of warning messages. You can display this message using java-script. Type in editor the following code. It is very simple, so you can easily study it out. For learning more about java script search the web for appropriate tutorials.