应用场景:我们在选择好radio跟select之后提交表单,返回历史记录时,再次选择,提交表单,发现提交的是上次表单选择的
解决办法:我们可以一进页面就给radio跟select的选项重置掉,因为,返回历史记录有执行js代码,解决代码如下:
//回退radio选项 $("[name='newplan_type']:eq(0),[name='plan_type']:eq(0)").prop("checked",true); //回退select选项 $(".phoneselect").eq(2).find("option").eq(0).attr("selected",true).siblings('option').attr("selected",false);