<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>
<Below this line, add a link to the EXACT exercise that you are stuck at.>
<In what way does your code behave incorrectly? Include ALL error messages.>
I just completed the course on Javascript during which time i coded in the code editor provided by codecademy.
Next thing i did was to try out executing javascript locally. The following is my code in it’s entirety:
`<html>
<head>
<title>JS prog to display date and time</title>
</head>
<body>
<script type = "text/javascript">
var today = new Date();
var day = today.getDay();
var daylist = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
console.log("Today is: " + daylist[day]);
var hour = today.getHours();
var minutes = today.getMinutes();
var seconds = today.getSeconds();
var doe = (hour >= 12)? "AM" : "PM";
hour = (hour>=12)? (hour - 12) : hour;
if(hour === 0 && doe === "PM");
{
if(minutes == 0 && seconds == 0)
{
doe = "Noon";
}
hour = 12;
}
else if(hour === 0 && doe ==="AM")
{
if(minutes === 0 && seconds ===0)
{
doe = "Midnight";
}
hour = 12;
}
console.log("Current time is: " + hour + doe + ":" + minute + seconds);
</script>
</body>
</html>`
When i run this on chrome all i get is a blank page. What’s wrong?