The example in this article describes how to obtain DOM nodes with jQuery. Share it with everyone for your reference, the details are as follows:
The wrapped DOM object in jQuery is actually an array. There are two ways to obtain a pure DOM object:
1. Use array index to access , for example:
2. Use the function get() to access , for example:
The parameter in the get() function is the index number.
3. Example
var div = document.createElement("DIV"); div.innerText = "TEST IS OK!"; document.body.appendChild(div); var $tmp = $(div); alert($tmp[0].innerText); //方式1获取DOM节点对象 alert($tmp.get(0).innerText); //方式2获取DOM节点对象
I hope this article will be helpful to everyone in jQuery programming.