$("input[type='checkbox']").change(function(){
if(this.checked){
if($(':checkbox:checked').length>1 && $('#qT').val()==1){
$(this).prop( "checked", false );
}
}
});
this is the script to run And html looks like below
<div class=row>....
<div class="isCorrect">
<span>correct</span>
<input type="checkbox" class="form-check-input mx-1"value="1">
</div>...</div>
<div class=row>....
<div class="isCorrect">
<span>correct</span>
<input type="checkbox" class="form-check-input mx-1"value="1">
</div>...</div>
etc etc
This code only checks the first check box. not any other.. I also tried
$("input[type='checkbox']").change(function(){
if(this.checked){
if($(':checkbox:checked').length>1 && $('#qT').val()==1){
$(this).prop( "checked", false );
}
}
}).triger(change);
and many other ways