$('#code').change(function(){标签:code,gs,val,js,JSON,缓存,localStorage,select,页面 From: https://www.cnblogs.com/zlf2000/p/16644447.html
console.log($(this).val())
localStorage.setItem("code",JSON.stringify({"sn":$(this).val(),"gs":$("#select").val()}));
});
$('#select').change(function(){
console.log($(this).val())
localStorage.setItem("code",JSON.stringify({"gs":$(this).val(),"sn":$("#code").val()}));
});
var code = localStorage.getItem("code");
if (code){
var code= JSON.parse(code);
$('#code').val(code.sn);
$('#select').val(code.gs);
}