遍历jquery对象的代码分享(3)


$("a").bind("click",function(e){
var $obj = $(e.target);
var i=0;
for (var x in $obj[0]){
i++;
var $hr=(i%5==0) ? "<hr />" : " ";
document.write(x+" "+$hr);
}
});


遍历结果:
jQuery16407028609993839658 querySelector querySelectorAll scrollTop scrollLeft
--------------------------------------------------------------------------------
scrollHeight scrollWidth clientTop clientLeft clientHeight
--------------------------------------------------------------------------------
clientWidth firstElementChild lastElementChild previousElementSibling nextElementSibling
--------------------------------------------------------------------------------
childElementCount children classList setCapture getElementsByClassName
--------------------------------------------------------------------------------
getClientRects getBoundingClientRect releaseCapture mozMatchesSelector addEventListener
--------------------------------------------------------------------------------
removeEventListener dispatchEvent style contentEditable isContentEditable
--------------------------------------------------------------------------------
offsetParent innerHTML offsetLeft offsetTop offsetHeight
--------------------------------------------------------------------------------
offsetWidth scrollIntoView href rel target
--------------------------------------------------------------------------------
name text search hash id
--------------------------------------------------------------------------------
title lang dir className accessKey
--------------------------------------------------------------------------------
blur focus click tagName removeAttributeNS
--------------------------------------------------------------------------------
removeAttribute getAttribute getElementsByTagName setAttribute getElementsByTagNameNS
--------------------------------------------------------------------------------
hasAttributeNS setAttributeNS hasAttribute getAttributeNS nodeName
--------------------------------------------------------------------------------
nodeValue nodeType parentNode childNodes firstChild
--------------------------------------------------------------------------------
lastChild previousSibling nextSibling attributes ownerDocument
--------------------------------------------------------------------------------
namespaceURI prefix localName baseURI textContent
--------------------------------------------------------------------------------
setUserData getUserData insertBefore replaceChild removeChild
--------------------------------------------------------------------------------
appendChild hasChildNodes cloneNode normalize isSupported
--------------------------------------------------------------------------------
hasAttributes compareDocumentPosition isSameNode lookupPrefix isDefaultNamespace
--------------------------------------------------------------------------------
lookupNamespaceURI isEqualNode tabIndex ELEMENT_NODE ATTRIBUTE_NODE
--------------------------------------------------------------------------------
TEXT_NODE CDATA_SECTION_NODE ENTITY_REFERENCE_NODE ENTITY_NODE PROCESSING_INSTRUCTION_NODE
--------------------------------------------------------------------------------
COMMENT_NODE DOCUMENT_NODE DOCUMENT_TYPE_NODE DOCUMENT_FRAGMENT_NODE NOTATION_NODE
--------------------------------------------------------------------------------
DOCUMENT_POSITION_DISCONNECTED DOCUMENT_POSITION_PRECEDING DOCUMENT_POSITION_FOLLOWING DOCUMENT_POSITION_CONTAINS DOCUMENT_POSITION_CONTAINED_BY
--------------------------------------------------------------------------------
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC getAttributeNode setAttributeNode removeAttributeNode getAttributeNodeNS
--------------------------------------------------------------------------------
setAttributeNodeNS ping hreflang type protocol
--------------------------------------------------------------------------------
host hostname port pathname charset
--------------------------------------------------------------------------------
coords rev shape hidden draggable
--------------------------------------------------------------------------------
spellcheck dataset
jQuery Get Tag Name

复制代码 代码如下:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wdjxyf.html