-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with "HTMLElement.style": IE11 fails unsetting style using null #16828
Comments
I could find a few other notes on Stack Overflow, for instance here and here. I haven't tested it personally yet, but according to the comments, assigning Also, on the MDN page, we may want to add a reference to an alternative solution: the |
I just successfully reproduced the issue, using Internet Explorer 11 and its "emulation mode" in the developer toolbar. All offered IE versions have the issue: 5, 7, 8, 9, 10, and even 11. (there is no IE 6, not a typo) Setting to |
I'm closing this issue since the IE data was frozen a few releases back. |
How about adding a short sentence, still? Something like:
|
MDN URL: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style
What information was incorrect, unhelpful, or incomplete?
To remove a given style, it is usually advised to set its property to
null
, e.g.element.style.color = null
However, it seems to silently fail on IE11, which requires to assign an empty string, e.g.
element.style.color = ''
(of course, other browsers support assigning an empty string too)
Specific section or headline?
Yes: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style#setting_styles
What did you expect to see?
If confirmed, this IE11 caveat should be documented.
Did you test this? If so, how?
According to this answer on Stack Overlow, and its comments:
https://stackoverflow.com/questions/18691655/remove-style-on-element/33039348#33039348
MDN Content page report details
en-us/web/api/htmlelement/style
The text was updated successfully, but these errors were encountered: