jQuery的三种遍历循环

0.总述

for循环

$.each

for in

1.简述

$.each(object,function(index,e){  ...  });    

object --> 需要遍历的对象或数组
index  --> 索引    
e      --> 循环的每个元素

2.代码




  • 1
  • 2
  • 3
  • 4

jQuery的三种遍历循环_第1张图片

3.for in

jQuery的三种遍历循环_第2张图片

你可能感兴趣的:(jQuery)