<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script type="text/jscript" src="../../js库/jquery-2.1.0.js"></script>
<script>
//JQ对象调用遍历
var city = ["深圳","广州","惠州","佛山"];
$(city).each(function(i,n){
console.log(i+" "+n);//i为索引,n为内容
});
//JQ函数调用遍历
$.each(city,function(i,n){//$.each(数组或对象,每个成员要执行的函数)
console.log(i+" "+n);//i为索引,n为内容
});
</script>
</body>
</html>
6.2 JQ遍历
最新推荐文章于 2022-09-24 21:00:42 发布