$("[name='hobby']").each(function(){//遍历JQuery对象
console.log(this);
});
$.each($("[name='hobby']"),function(){//遍历JQuery对象
console.log(this);
});
var names=["Jim","Tom","Lucy"];
$.each(names, function(i,value) {//遍历数组
console.log(i+":"=value);
});
each(callback)与each(object[, callback])区别
最新推荐文章于 2022-04-12 21:12:14 发布