引用:http://www.cnblogs.com/bynet/archive/2009/11/13/1602491.html



















jQuery.attr 获取/设置对象的属性值,如:
$("input[name='chk_list']").attr("checked"); //读取所有name为'chk_list'对象的状态(是否选中)
$("input[name='chk_list']").attr("checked",true); //设置所有name为'chk_list'对象的checked为true
再如:
$("#img_1").attr("src","test.jpg"); //设置ID为img_1的<img>src的值为'test.jpg'
$("#img_1").attr("src"); //读取ID为img_1的<img>src值
下面的代码是获取上面实例中选中的checkbox的value值:










哪位高手能把上面遍历的过程用$.each()写出来,不胜感激。
在此谢谢rainnoless的帮助,下面是用$.each()遍历的代码:






