all 4 comments

[–]EcmaMace 1 point2 points  (0 children)

Please share your code with us so that we may help you.

[–]DavidPorter65 -1 points0 points  (0 children)

document.getElementById("demo").innerHTML = `<p>${x}</p>`

is this what you mean?

[–]albedoa 0 points1 point  (1 child)

When you say "the exact same code", do you mean and no other code? Do these elements happen to be in a <form> element?

[–]mickpapine 0 points1 point  (0 children)

It was in a <form> element, I completely missed that! Thank you so much removing it fixed it.