当点击Clear按钮是单选框恢复到默认的选项
问题描述:
department_radio是默认选项(部门名)的id号,其他文本框的清除效果都能实现就这个单选按钮不知道怎么恢复默认值。求指教
答
设置选中,试试这个 $("#department_radio").prop("checked",true); id 唯一选中操作。
attr("checked","checked") 也是选中,attr("checked","")是取消选中,这两种方式影响数据获取
参考这篇:https://blog.csdn.net/wojiushiwo945you/article/details/91333534
答
$("#department_radio").removeAttribute("checked");