jquery怎么判断checkbox是否被选中

如题所述

<!DOCTYPE HTML>
<html>
<head>
<title>yugi</title>
<meta charset=UTF-8 />
<style type="text/css">
</style>
<script type="text/javascript" src="jquery-1.8.0.min.js"></script>
<script type="text/javascript">
jQuery (function ($)
    {
    $ (":checkbox").change (function ()
    {
    alert ($ (this).is (":checked"));
    })
    });
</script>
</head>
<body>
<input type="checkbox" />
</body>
</html>

温馨提示:内容为网友见解,仅供参考
第1个回答  2015-03-01
$("input[type='checkbox']").is(':checked')
相似回答