I just want to check that there is no medical history, and the other four items are unchecked
check any of the other four items. No medical history is not selected.
but now that the other four items are singled, the other selected items will also be unchecked.
the environmental background of the problems and what methods you have tried
related codes
< div class= "ill_his_btn clearfix" >
<label class="weui-btn weui-btn_mini weui-btn_primary"><input name="medical_history[]{if strpos($case.medical_history,"")!==false}" checked="checked{/if}" value="" type="checkbox"></label>
<label class="weui-btn weui-btn_mini weui-btn_primary"><input name="medical_history[]{if strpos($case.medical_history,"")!==false}" checked="checked{/if}" value="" type="checkbox"></label>
<label class="weui-btn weui-btn_mini weui-btn_primary"><input name="medical_history[]{if strpos($case.medical_history,"")!==false}" checked="checked{/if}" value="" type="checkbox"></label>
<label class="weui-btn weui-btn_mini weui-btn_primary"><input name="medical_history[]{if strpos($case.medical_history,"")!==false}" checked="checked{/if}" value="" type="checkbox"></label>
<label class="weui-btn weui-btn_mini weui-btn_primary"><input name="medical_history[]{if strpos($case.medical_history,"")!==false}" checked="checked{/if}" value="" type="checkbox"></label>
</div>
$("input [type = "checkbox"]") .click (function () {
console.log($($(this).parent().siblings()[0]).children());
var v = this.value;
if(v = ""){
if(this.checked){
$(this).parent().removeClass("weui-btn_default").addClass("weui-btn_primary");
$(this).parent().siblings().removeClass("weui-btn_primary").addClass("weui-btn_default").children().each(function(){
this.checked = false;
})
}else{
$(this).parent().removeClass("weui-btn_primary").addClass("weui-btn_default");
}
}else{
if(this.checked){
$(this).parent().removeClass("weui-btn_default").addClass("weui-btn_primary");
$(".weui-btn:first-child").removeClass("weui-btn_primary").addClass("weui-btn_default").children().each(function(){
this.checked = false;
})
}else{
$(this).parent().removeClass("weui-btn_primary").addClass("weui-btn_default");
}
}
})