Jquery模拟同意条款
Jquery代码 :
<script src="script/jquery-1.7.1.js" type="text/javascript"></script>
<script type="text/jscript">
$(document).ready(function(){
var $cr = $("#cr");
$cr.click(function(){
if($cr.is(":checked")){ //判断ID为cr的元素,是否被选中
alert("感觉你的支持");
}
})
})
</script>
HTML代码:
<body>
<input type="checkbox" id="cr" />
<label for="cr">我已经阅读了上面制度</label>
</body>
附图:
转载于:https://blog.51cto.com/1120173856/937876