15th Aug 2017, 7:41 AM
ARB
ARB - avatar
2 Respuestas
+ 3
here... window.onload = function(){ alert("solve pls"); var month = new Date(); var now = month.getMonth() switch(now){ case 0: now = "January"; break ; case 1: now = "February"; break ; case 2: now = "March"; break ; case 3: now = "April"; break ; case 4: now = "May"; break ; case 5: now = "June"; break ; case 6: now = "July"; break ; case 7: now = "August"; break ; case 8: now = "September"; break ; case 9: now = "October"; break ; case 10: now = "November"; break ; case 11: now = "December"; } document.write(now) }
15th Aug 2017, 8:22 AM
Nomeh Uchenna Gabriel
Nomeh Uchenna Gabriel - avatar
+ 1
It works when it's december UPDATE: Just ran it. It also appears that document.body is null at the time when the js is executed. So either that document.body.innerhtml = must be replaced with something like document.write(), or the code should be placed in a function that is executed after the document is loaded.
15th Aug 2017, 8:02 AM
deFault