$("input[type='checkbox']").each(function(i){
$(this).attr("checked",true);
});
<head>
<title></title>
<script src="jquery-1.9.0.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('input:hidden').each(function (index, obj) {
alert(obj.name + "..." + obj.value);
});
});
</script>
</head>
<body>
<input type="hidden" value="1" name="a"/>
<input type="hidden" value="2" name="b"/>
<input type="hidden" value="3" name="c"/>
</body>
$.each(["aaa","bbb","ccc"],function(index,value){
alert(i+"..."+value);
});
$(function () {
$.each([["aaa", "bbb", "ccc"], ["ddd", "eee", "fff"], ["ggg", "hhh", "iii"]], function (index, item) {
alert(index + "..." + item);
//输出0...aaa,bbb,ccc 1...ddd,eee,fff 2...ggg,hhh,iii 这时的index为数组下标,item相当于取这二维数组中的每一个数组
$.each(item, function (index, itemobj) {
alert(index + "....." + itemobj);
});
});
//输出0...aaa,bbb,ccc 0...aaa 1...bbb 2...cccc 1...ddd,eee,fff 0...ddd 1...eee 2...fff 2...ggg,hhh,iii 0...ggg 1...hhh 2...iii
});
$(function () {
var json = [{ name: "张三", sex: "男" }, { name: "李四", sex: "女" }, { name: "王五", sex: "gay"}]; //自定义一个json数组
$.each(json, function (index, obj) {
alert(index + "..." + obj.name+"..."+obj.sex);
});
});
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有