My JS Said there is an unexpected token but there is not? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

My JS Said there is an unexpected token but there is not?

I wonder why this code raises an error when I click on the "=" button: `Uncaught SyntaxError: Unexpected token "<", line 3`, while I don't see the unexpected token anywhere in the code.. How do I fix it? Thanks!! https://code.sololearn.com/WeLw6Q04t4nl/?ref=app

12th Aug 2023, 11:30 AM
Dragon RB
Dragon RB - avatar
2 Answers
+ 5
Try innerText instead innerHTML screen.innerHTML = <p style = "font-size:15px;opacity:0.6;">PrevAns = </p>
12th Aug 2023, 12:36 PM
lolo
lolo - avatar
+ 1
lolo Ohh so it is because of the paragraph inside the screen class! But still, I also want the paragraph to appear without any errors.. Anyways thank you.
12th Aug 2023, 1:00 PM
Dragon RB
Dragon RB - avatar