jquery获取checkbox 选中数量

来源:互联网 发布:拳皇2002出招优化补丁 编辑:程序博客网 时间:2024/06/13 11:38
<div>     <input type="checkbox" name="fruit"> apple    <input type="checkbox" name="fruit"> orange    <input type="checkbox" name="fruit"> banana    <input type="checkbox" name="fruit"> watermelon    <input type="button" value="I like these fruit!"></div>
alert($("input[type='checkbox']:checked").length)