jquery的each方法使用
each是jquery提供的公用方法,用来迭代出所有符合同一规则的值的索引(index)和内容(value),使用如下:
1 遍历某个元素,如所有div
$("div").each(function(index,value){
console.log(“index:”+index+",value:"+$(this).attr("id"));
});
$.each($("div"),fun
原创
2017-07-29 13:01:31 ·
363 阅读 ·
0 评论