HTML代码:如果Chekbox检查或检查不
<div class="checkbox" style=" float:left "></div>
<input type="checkbox" class="realcheckbox" id="financing" />
jQuery代码:
$(".checkbox").click(function() {
var xchecked = $(this).siblings(".realcheckbox").attr("checked");
if (xchecked == false) {
$(this).css("background-image","url('checkboxselected.png')");
$(this).next(".realcheckbox").attr("checked",true);
}
else {
$(this).css("background-image","url('checkbox.png')");
$(this).next(".realcheckbox").attr("checked",false);
}
});
点击假的复选框没有检查真实的,但如果真正是一个检查,点击假冒的人正在完成这项工作,意味着真正的人得不到控制,第一个人出了什么问题?
这里回答这里 http://stackoverflow.com/questions/901712/check-checkbox-checked-property-using-jquery –
请记住,您可以检查复选框,而不是点击它。 – David
这是在下面的页面队友回答,[http://stackoverflow.com/questions/901712/check-checkbox-checked-property-using-jquery](http://stackoverflow.com/questions/901712/check- checkbox-checked-property-using-jquery)祝你有美好的一天! –