Element.prototype.classList: Multiple class names
See original GitHub issueThere’s a bug in IE 10-11 and Firefox < 24 with multiple class names:
element.classList.add('class1', 'class2');
Issue Analytics
- State:
- Created 9 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Is there a way to add/remove several classes in one single ...
createElement('div'), dtp = DOMTokenList.prototype, toggle = dtp.toggle, add = dtp.add, rem = dtp.remove; ...
Read more >Element.classList - Web APIs | MDN
The Element.classList is a read-only property that returns a live DOMTokenList collection of the class attributes of the element.
Read more >Add and remove multiple classes in JavaScript for DOM element
The classList property should be your primary way to work with classes in JavaScript. The classList property has add() and remove() methods that ......
Read more >HTML DOM Element classList Property - W3Schools
The classList property returns the CSS classnames of an element. ... Add multiple classes to the an element: element.classList.add("myStyle", "anotherClass" ...
Read more >Add multiple classes to an Element using JavaScript
To add multiple classes to an element, select the element and pass multiple classes to the classList.add() method, e.g. box.classList.add('bg-blue', ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I moved the tangential discussion, but the multiple classnames remains unresolved. Since we no longer have variants, using Eli grey’s polyfill would be simple enough, so I’d suggest replacing the existing polyfill with that.
This will be fixed via https://github.com/Financial-Times/polyfill-service/pull/1347