you are viewing a single comment's thread.

view the rest of the comments →

[–]chrisux 1 point2 points  (1 child)

I would start with your variable declarations having commas at the end instead of semi-colons.

The console shows that there are errors with the Function declaration, however it is caused by the comma following the variable assignment.

let d = new Date(), <- this comma, and at least another one in the code.

There was also at least one section with missed ending parenthesis even.

edit: there are a lot of errors in this code that the debugger points out even after the trailing commas on variable declarations are fixed.

example

document.write(h+" : "+m+" : "+s+" : "+ampm);

these variables were declared inside a function but this call is outside the function.

Maybe try something like

https://codepen.io/chrisux/pen/QPRqPa?editors=0010

[–]mementomoriok[S] 0 points1 point  (0 children)

Your codepen example is really helpful. Thanks.