JavaScript in the Browser

Including JavaScript in HTML

<html>
  <head>
    <title>The date</title>
    <script language="JavaScript">
      function printDate() {
      var d = new Date();
      document.write(d.toLocaleString());
      }
    </script>
  </head>

  <body>
    <p>The date and time are:<br/>
      <script language="JavaScript">
        printDate();
      </script>
    </p>
  </body>
</html>
Load it

José M. Vidal .

3 of 66