each

阅读数:948 发布时间:2016-09-30 09:13:28

作者:w4why 标签: each zepto

each

each(function(index, item){ ... }) ⇒ self 遍历一个对象集合每个元素。在迭代函数中,this关键字指向当前项(作为函数的第二个参数传递)。如果迭代函数返回 false,遍历结束。

$('form input').each(function(index){
  console.log('input %d is: %o', index, this)
})

相关文章推荐: