-2
 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."

1 Answers1

1

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)

Chubas
  • 17,823
  • 4
  • 48
  • 48