<div class="uba b-gra umar-b uc-a1 "> <div class="ub uinnm9 bc-border ubb"> <div class="ub ub-ac ub-f1 "> <div class=" uinput ub ub-f1 "> <div class="umhw resuser ub-img umar-l"></div> <div class="ub-f1 my-fontC"> <input placeholder="用户名" id="uid" value="" type="text" style="color:white;"/> </div> </div> </div> </div> <div style="100%;"> <div style="margin:1em auto;60%;"> <input type="checkbox" style="3em;height:3em;" id="remem"> <label style="font-size:1em;line-height:1em;">记住账号</label> </div> </div>
</div>
js代码为:
var check = document.getElementById("remem"); var user = document.getElementById("uid"); var loUser = appcan.locStorage.getVal("user"); var isStoreUser = appcan.locStorage.getVal("isStoreUser"); if(appcan.locStorage.getVal('user')==""||appcan.locStorage.getVal('user')==null){ $("#remem").removeAttr("checked"); }else{ $("#remem").attr("checked",true); } if(isStoreUser=="yes"){ user.value = loUser; } $("#remem").change(function(){ if($("#remem")[0].checked==true){ appcan.locStorage.setVal("user",user.value); appcan.locStorage.setVal("isStoreUser","yes"); }else{ appcan.locStorage.setVal("isStoreUser","no"); } });