Why Chrome don't print Element.classList property with a console.log()

cocoggu

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 ?

Pointy

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Why i don't get the console.log in JS

From Dev

Why can't the console in Xcode print my object's property using dot notation?

From Dev

Why my PrintWriter doesn't print on console if I don't use PrintWriter(Writer out,boolean autoFlush) constructor?

From Dev

Why I can't pass console.log as a callback argument in Chrome (and Safari)?

From Dev

why print statement don't work as intended?

From Dev

Why don't my iptables log?

From Dev

Don't print the kafka-console-consumer warnings

From Dev

Why won't Angular log to Firebug console

From Dev

Element.classList Cannot read property 'toggle'

From Dev

Log IOError only in console, don't send mails

From Dev

How to make accordion doesn't work and tell me Cannot read property 'classList' of undefined if element existed?

From Dev

Why does console.log wrongly print an empty array?

From Dev

Why does console.log() only print member fields?

From Dev

My style sheet css don´t show lines in the console Chrome

From Dev

Don't know the best way to check for a console error in chrome

From Dev

My style sheet css don´t show lines in the console Chrome

From Dev

Application Cache : why Chrome show some files underlined in the console log?

From Dev

Chrome developer tools console showing faded Javascript object property, why?

From Dev

Print content of element to console

From Dev

Why don't AngularJS errors in the html show up in the console?

From Dev

Why don't these string expressions print the same result?

From Dev

The getGeneratedKeys() to print key don't work. Why?

From Dev

TypeScript: Why let print = console.log.bind(console) only works if there is a import before it?

From Dev

Why doesn't this while loop print anything on console?

From Dev

Print array content in console log

From Dev

Why i don't have the property Items on listView1?

From Dev

Why don't these images accept display: inline property?

From Dev

Why doesn't .includes() work with .classList?

From Dev

Why don't CSS filters work on SVG elements in Chrome?

Related Related

  1. 1

    Why i don't get the console.log in JS

  2. 2

    Why can't the console in Xcode print my object's property using dot notation?

  3. 3

    Why my PrintWriter doesn't print on console if I don't use PrintWriter(Writer out,boolean autoFlush) constructor?

  4. 4

    Why I can't pass console.log as a callback argument in Chrome (and Safari)?

  5. 5

    why print statement don't work as intended?

  6. 6

    Why don't my iptables log?

  7. 7

    Don't print the kafka-console-consumer warnings

  8. 8

    Why won't Angular log to Firebug console

  9. 9

    Element.classList Cannot read property 'toggle'

  10. 10

    Log IOError only in console, don't send mails

  11. 11

    How to make accordion doesn't work and tell me Cannot read property 'classList' of undefined if element existed?

  12. 12

    Why does console.log wrongly print an empty array?

  13. 13

    Why does console.log() only print member fields?

  14. 14

    My style sheet css don´t show lines in the console Chrome

  15. 15

    Don't know the best way to check for a console error in chrome

  16. 16

    My style sheet css don´t show lines in the console Chrome

  17. 17

    Application Cache : why Chrome show some files underlined in the console log?

  18. 18

    Chrome developer tools console showing faded Javascript object property, why?

  19. 19

    Print content of element to console

  20. 20

    Why don't AngularJS errors in the html show up in the console?

  21. 21

    Why don't these string expressions print the same result?

  22. 22

    The getGeneratedKeys() to print key don't work. Why?

  23. 23

    TypeScript: Why let print = console.log.bind(console) only works if there is a import before it?

  24. 24

    Why doesn't this while loop print anything on console?

  25. 25

    Print array content in console log

  26. 26

    Why i don't have the property Items on listView1?

  27. 27

    Why don't these images accept display: inline property?

  28. 28

    Why doesn't .includes() work with .classList?

  29. 29

    Why don't CSS filters work on SVG elements in Chrome?

HotTag

Archive