How to use JavaScript

JavaScript can be written at any place in the page or can be in external file. JavaScript is written in the head section in <script> tag.


Other examples in Basic (JavaScript tutorial)
Result from the Online TryIt-Editor
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 4.0