<input type="radio" value="1" checked="" name="purifyse">安装
<input type="radio" value="0" name="purifyse" >未安装
//改变
$(':radio').click(function(){
var showFlag = $('input:radio[name="purifyse"]:checked').val();
if(showFlag==1){
$("#purifyBox").removeClass("hide");
}
else {
$("#purifyBox").addClass("hide");
}
});
注:有些框架中对于input做了样式优化,点击时没有反应,查看是否隐藏真正的input。
参考链接:
cnblogs.com/z360519549/p/10628269.html
https://blog.csdn.net/aphy358/article/details/50250069?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task
https://blog.csdn.net/weixin_34185320/article/details/93572430