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


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


遍历结果:
0 context length constructor init
--------------------------------------------------------------------------------
selector jquery size toArray get
--------------------------------------------------------------------------------
pushStack each ready eq first
--------------------------------------------------------------------------------
last slice map end push
--------------------------------------------------------------------------------
sort splice extend data removeData
--------------------------------------------------------------------------------
queue dequeue delay clearQueue promise
--------------------------------------------------------------------------------
attr removeAttr prop removeProp addClass
--------------------------------------------------------------------------------
removeClass toggleClass hasClass val bind
--------------------------------------------------------------------------------
one unbind delegate undelegate trigger
--------------------------------------------------------------------------------
triggerHandler toggle hover live die
--------------------------------------------------------------------------------
blur focus focusin focusout load
--------------------------------------------------------------------------------
resize scroll unload click dblclick
--------------------------------------------------------------------------------
mousedown mouseup mousemove mouseover mouseout
--------------------------------------------------------------------------------
mouseenter mouseleave change select submit
--------------------------------------------------------------------------------
keydown keypress keyup error find
--------------------------------------------------------------------------------
has not filter is closest
--------------------------------------------------------------------------------
index add andSelf parent parents
--------------------------------------------------------------------------------
parentsUntil next prev nextAll prevAll
--------------------------------------------------------------------------------
nextUntil prevUntil siblings children contents
--------------------------------------------------------------------------------
text wrapAll wrapInner wrap unwrap
--------------------------------------------------------------------------------
append prepend before after remove
--------------------------------------------------------------------------------
empty clone html replaceWith detach
--------------------------------------------------------------------------------
domManip appendTo prependTo insertBefore insertAfter
--------------------------------------------------------------------------------
replaceAll css serialize serializeArray ajaxStart
--------------------------------------------------------------------------------
ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend
--------------------------------------------------------------------------------
show hide _toggle fadeTo animate
--------------------------------------------------------------------------------
stop slideDown slideUp slideToggle fadeIn
--------------------------------------------------------------------------------
fadeOut fadeToggle offset position offsetParent
--------------------------------------------------------------------------------
scrollLeft scrollTop innerHeight outerHeight height
--------------------------------------------------------------------------------
innerWidth outerWidth width

再遍历:

复制代码 代码如下:

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

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