Skip to content
Advertisement

Trying to remove attribute from HTML using JS

Ive made a quiz app, with HTML and JS only and im trying to remove an id from a element which has the attribute, however when i run the code to remove it my JS doesnt find the attribute in any of the elements, if i manually inspect i can see it in the html?

i do add this element in the JS above it, could this be because the DOM hasnt updated?

JavaScript

Advertisement

Answer

I have changed some things around and used a class instead of id which seems to work much better.

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement