How to write 1st JavaScript program

priyal_hdp

Active member
  • Jan 2, 2009
    315
    38
    28
    This example displays how to use javascript to write something in the HTML Document

    <html>
    <body>
    <script type = "text/javascript">
    document.write ("Hello!.. This is my 1st Javascript program");
    </script>
    </body>
    </html>

    Following example displays how to use HTML elements within the javascript

    <html>
    <body>
    <script type = "text/javascript">
    document.write ("<h2>Hello!.. This is my 1st Javascript program</h2>");
    </script>
    </body>
    </html>

    get more knowledge about web programming. Enjoy Programming... Its easy...:yes: