Exercise Time! 10



Add the following JavaScript code segments to a web page and observe the results:

  1. <BODY><SCRIPT LANGUAGE="JavaScript">
    <!--
    document.writeln("<BR>");
    document.writeln("This page was last modified on ");
    document.writeln(document.lastModified + "<BR>");
    // -->
    </SCRIPT></BODY>
    



  2. 	
    <HTML><HEAD>
    <TITLE>JavaScript Test Page</TITLE>
    <SCRIPT LANGUAGE="JavaScript"><!--
    var seconds = 60;
    function counter() {
            document.countdown.counter.blur();
            seconds -= 1;
            document.countdown.counter.value = seconds;
            id = setTimeout("counter()", 1000);
    }
    // --></SCRIPT>
    </HEAD>
    <BODY>
    <FORM NAME="countdown">
    In <INPUT TYPE="text" NAME="counter" SIZE=2 VALUE="60"
            onFocus="this.blur();"> 
    seconds this page will self destruct.
    <SCRIPT LANGUAGE="JavaScript"><!--
    counter();
    //--></SCRIPT> 
    </BODY></HTML>