0
在取消選中所有複選框後,我想讓單選按鈕選中,但現在當我取消選中所有複選框時,它不起作用。幫助!如何在取消選中複選框時選中選中單選按鈕
<script>
$(document).ready(function() {
function uncheck(radio,checkbox){
var fliter_checkbox=$(checkbox);
var fliter_radio=$(radio);
fliter_checkbox.click(function(){
fliter_checkbox.each(function(){
fliter_radio.attr("checked",false);
if(fliter_checkbox.attr("checked")==false){
fliter_radio.attr("checked",true);
}
})
})
fliter_radio.click(function(){
fliter_radio.each(function(){
fliter_checkbox.attr("checked",false);
})
})
}
uncheck('#fliter input[name="vendor_all"]','#fliter input[name="vendor"]');
})
</script>