码迷,mamicode.com
首页 > 其他好文 > 详细

checked

时间:2016-06-27 23:01:16      阅读:197      评论:0      收藏:0      [点我收藏+]

标签:

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript" src="jquery.js"></script>

</head>
<body>
<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<br>
<input type="button" value="I like these fruit!">
</div>

<script>
$(function(){
$("input[type=‘button‘]").click(function() {
alert($("input[type=‘checkbox‘]:checked").length);
});
})

</script>
</body>
</html>

checked

标签:

原文地址:http://www.cnblogs.com/uman/p/5621617.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!