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