JavaScript and changing form attributes (colors)

Fred_Deroche_at_corpsoftnorwood4@stream.com
Mon, 03 Feb 97 08:06:29 EST


From: Fred_Deroche_at_corpsoftnorwood4@stream.com
Date: Mon, 03 Feb 97 08:06:29 EST
Message-Id: <9701038549.AA854993059@smtpmail.stream.com>
To: www-html@www10.w3.org
Subject: JavaScript and changing form attributes (colors)

     Good Morning,
     
     The following script run onload() in the BODY statement.
     I want the script to change colors/background based on the time.
     
     Problems I'm having...
     
     1. getMinutes is not defined - How can I set a variable minutes ?
     2. setting bgcolor works when I change the variable manually,
         but how do you change the text color ?
     
     <SCRIPT LANGUAGE="JavaScript">
     function bkcolor()
     {       var now = Date();
             var minutes = getMinutes(); <--- receives error
             minutes = getMinutes();     <--- receives error
             var minutes = 22;           <--- works
     
        if (minutes > 30)        
                {document.fgColor='white'};
        if (minutes > 30)        
                {document.bgColor='darkgreen'} ;
     
     
     
     thanks, fred