According to this document https://developer.mozilla.org/en-US/docs/Web/API/Element.classList , the classList property is a DOMTokenList Object in the Element class.
With Chrome, when I print console.log(document.Element.prototype);
I can't find any classList property, but when I do that
if (("classList" in document.createElement("_"))) {...}
The condition is true. In an other hand, when I do that
if (!('classList' in window.Element)) {...}
The condition is also TRUE ! There should be something I'm missing but what ?
It's not a property of the Element prototype, it's a property of each DOM node (well, each element node).
Understand that the DOM API is specified in a way that describes what code can expect of DOM objects, but it doesn't say how that functionality works in any particular implementation (which is kind-of silly but there you go).
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments