7 Replies
the error is self-explanatory
if
takes an expression between ()
you have an if
without the expression
so, document
is unexpected there
remove the if
and start using braces
also, Checked
doesn't exist
it MUST be checked
also also document.getElementById
takes an id, but you're put a css selector - remove the #
also also also, store document.getElementById
in a variableDEAR LORD, THAT IS HORRIBLE
you're trying to learn javascript from bad code from 2013
learn from there
in your code you used
else if
in the page you linked they used else
with else if you need to add condition inside ()
just like in if