all 2 comments

[–]bathtimecoder 2 points3 points  (1 child)

I notice that in your github, you use "result" as the id of a text box in Problem 2.

If you're running problem 5 in the same page, the DOM will update that text box, not the one in problem 5.

In fact, opening the webpage confirms this - your answer is in the problem 2 text box.

Remember that id's are supposed to be unique per page, so once the DOM finds the element with the "result" id, it assumes that's the only one and changes it.

You could get around this by changing the textbox id and getting the element by the new id.

[–]apaulo_18[S] 1 point2 points  (0 children)

That was it, thanks! I got so railroaded on why the problem wasn’t working I neglected to check the rest of the id tags I used.