I am modifying the ID of an HTML div
element client side with JavaScript. The following code works OK in Internet Explorer but not in Firefox/2.0.0.20. It does work in more recent versions of Firefox.
document.getElementById('one').id = 'two';
Can anyone tell me:
- Why this doesn't work in FireFox.
- How to make this work in FireFox.
To clarify, I'm changing the element ID to reference a different style in an external style sheet. The style is applied in IE but not in FF.
question from:https://stackoverflow.com/questions/1650299/how-do-i-change-the-id-of-a-html-element-with-javascript