jQuery中$.each()与collection.each()中的function()函数
jQuery中$.each()与collection.each()中的function()函数
两者都是可以同遍历jQuery对象与非jQuery对象的方法,基本使用如下:
var li = $("li");
li.each(function(index,element){
console.log(index);
console.log($(this).text());
}
);...
原创
2019-05-05 15:48:40 ·
474 阅读 ·
0 评论