JavaScript Tutorial - 3 - one possible answer to Task 7
<html> <head> <title>What month is it?</title> </head> <body> <script> var now=new Date() if (now.getMonth()==0) { document.write("January") } if (now.getMonth()==1) { document.write("February") } if (now.getMonth()==2) { document.write("March") } if (now.getMonth()==3) { document.write("April") } if (now.getMonth()==4) { document.write("May") } if (now.getMonth()==5) { document.write("June") } if (now.getMonth()==6) { document.write("July") } if (now.getMonth()==7) { document.write("August") } if (now.getMonth()==8) { document.write("September") } if (now.getMonth()==9) { document.write("October") } if (now.getMonth()==10) { document.write("November") } if (now.getMonth()==11) { document.write("December") } </script> </body> </html>
HOME Table of Contents