What's the difference between a jQuery object and a DOM element? Difference between .get() and .index()?

后端 未结 7 1014
慢半拍i
慢半拍i 2020-12-03 12:16

I\'m lead to this question when trying to figure out the difference between jQuery\'s .get() and .index(), I\'ve looked over the jQuery API and I s

7条回答
  •  没有蜡笔的小新
    2020-12-03 12:38

    DOM is not the structure of the page such as below

     etc.
    

    DOM is only a representation of the page
    Loosely speaking, DOM is a kind of an Object-Oriented Programming Language, which enables you to access and manipulate on the actual document.

    document.getElementById("a") 
    /* here document is an object and getElementById is an method of it */ 
    

    To be more precise, DOM is an interface rather than an programming language and it's language independent. It happened to be included in Javascript.

提交回复
热议问题