loligator Posted September 2, 2009 Report Share Posted September 2, 2009 I was following the tutorial on W3Schools for javascript and got a little side tracked and started messing around with the code so I could figure it out. It stopped working and I don't know what I changed. It doesn't matter a whole lot but it is hard to learn when I don't know what I'm doing wrong. here is my script:<html><body><script type="text/javascript">var date = new Date();var time = d.getHours();var min = d.getMinutes();if (time > 0 && time < 10) { document.write("<b>Good Morning</b>"); }else (time > 10 && time < 17) { document.write("<b>Good Afternoon</b>"); }else (time > 17 && time < 24) { document.write("<b>Good Evening</b>"); }//Display Timedocument.write("<br>Current Time ");document.write(time);document.write(":");document.write(min);document.write("<br>");document.wriet(date);</script></body></html> Link to comment Share on other sites More sharing options...
jeffman Posted September 2, 2009 Report Share Posted September 2, 2009 (edited) var date = new Date();var time = d.getHours();It would seem you wrote d when you meant to write dateAnd there may be a couple things wrong here:document.wriet(date); Edited September 2, 2009 by Deirdre's Dad Link to comment Share on other sites More sharing options...
loligator Posted September 2, 2009 Author Report Share Posted September 2, 2009 And there may be a couple things wrong here:document.wriet(date);LOL thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now