document.write("<img src='" + imgNumber + ".png' alt="' /> ") ;
I get a syntax error with this code.
"Insert a command that writes this text img src='imgNumber.png' alt='' /> where imgNumber is the value of the imgNumber variable."
document.write("<img src='" + imgNumber + ".png' alt="' /> ") ;
I get a syntax error with this code.
"Insert a command that writes this text img src='imgNumber.png' alt='' /> where imgNumber is the value of the imgNumber variable."
I recommend you to read about Javascript strings, you got a syntax error because of the double quotes following alt="
, you need to either escape them or use separate strings and concatenate them (all in the reference link)