日期:2014-05-16 浏览次数:20450 次
<script src="jQuery/jquery-1.6.2.min.js"></script> <script> $(function(){ $("#mycheckbox").click(function(){ var s = $(this).attr("checked"); alert(s); }) }); </script> <input type='checkbox' id='mycheckbox' />
<script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(function(){ $("#mycheckbox").click(function(){ var s = this.checked; alert(s); }) $("#mybutton").click(function(){ var i = $("#mycheckbox")[0].checked; alert(i); }) }); </script> <input type='checkbox' id='mycheckbox' /> <input type='button' id='mybutton' value='按钮' />