我的新博客

jquery读取checkbox的值

////////////////////////////////////////////HTML代码,checkbox///////////////////////////////////////////////////////////////////
                         <td style="width: 150px"> <label> <input id="checkDesign" type="checkbox" name="operType" value="Design" />Design </label> </td> <td style="width: 150px"> <label> <input id="checkFoundry" type="checkbox" name="operType" value="Foundry" /> Foundry </label> </td> <td style="width: 150px"> <label> <input id="checkOthers" type="checkbox" name="operType" value="Others" /> Others </label> </td>

 

 


////////////////////////jquery读取上面checkbox的所有被勾选的值////////////////////////

var notes = new Array();
$('input:checkbox:checked').each(function (i) {
  notes.push($(this).val());
});

 

posted on 2015-03-23 11:44  无双2013abc  阅读(530)  评论(0)    收藏  举报