JavaScript Tutorial - 3 - one possible answer to Task 6
<html> <head> <title>What day is it?</title> </head> <body> <script> var now=new Date() if (now.getDay()==0) { document.write("Sunday") } if (now.getDay()==1) { document.write("Monday") } if (now.getDay()==2) { document.write("Tuesday") } if (now.getDay()==3) { document.write("Wednesday") } if (now.getDay()==4) { document.write("Thursday") } if (now.getDay()==5) { document.write("Friday") } if (now.getDay()==6) { document.write("Saturday") } </script> </body> </html>
HOME Table of Contents