**input[type=radio] 点击选中后,再次点击选中项,默认是不会取消的。**用jquery实现点击选中取消的代码:
$(“body”).on(“click”,“#video-select-modal .video_table .click-box input[name=‘hobby’]”,function(){
var name = $(this).attr(“che”);
$(“:radio[name=”+ name +“]:not(:checked)”).attr(“tag”,0);
if( $(this).attr(“tag”) == 1 ) {
$(this).attr(“checked”,false);
$(this).attr(“tag”,0);
}else {
$(this).attr(“tag”,1);
}
})
jquery解决input[type=radio]点击选中取消
最新推荐文章于 2023-10-09 13:59:23 发布