Public feed #724217

Fun with JavaScript

public javascript v1 · immutable
Raw Edit
·published 2007-10-03 13:07 UTC
rendered paste body
<div id="box1"><script type="text/javascript">//This will make some alert boxes appear//It will also make the user input their name and their name will appear on the pagevar d = new Date();var time = d.getHours();var min = d.getMinutes();var question="What is your name?";var response = prompt(question,"Joshua");if (time < 12);{document.getElementById("box1").innerHTML = "Hello&nbsp;" + response + "! It is&nbsp;" + time + ":" + min + "AM";}else if (time > 12);{document.getElementById("box1").innerHTML = "Hello&nbsp;" + response + "! It is&nbsp;" + time + ":" + min + "PM";}</script></div>/*This was created by Joshua. October 03, 2007 8:07AM.*Removal of this comment is prohibited*/