Closed qfox closed 8 years ago
Are you sure that it is necessary to do do ?
Could you give some links to spec ?
ex1:
var elem = document.createElement('div');
elem.className = 'popup popup open popup';
console.log(elem.classList); // ["popup", "popup", "open", "popup"]
ex2:
var elem = document.createElement('div');
elem.classList.add('popup')
elem.classList.add('popup')
elem.classList.add('open')
elem.classList.add('popup')
console.log(elem.classList); // ["popup", "open"]
It should be an option or used by default?
I don't see why it should be hidden under option. It's like resorting class names inside class attribute.
<div class="popup welcome popup popup welcome"></div>
should be equivalent to<div class="welcome popup"></div>