欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

JS實現(xiàn)兩周內(nèi)自動登錄功能

 更新時間:2017年03月23日 11:40:56   作者:xing.org1^  
這篇文章主要為大家詳細介紹了JS實現(xiàn)兩周內(nèi)自動登錄功能的相關(guān)資料,具有一定的參考價值,感興趣的小伙伴們可以參考一下

本文實例為大家分享了Android九宮格圖片展示的具體代碼,供大家參考,具體內(nèi)容如下

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>兩周內(nèi)自動登錄</title>
    <script src="cookie.js" type="text/javascript" charset="utf-8"></script>
  </head>
  <body>
    <form action="" method="post" id="form1">
      <input type="text" name="user" id="user" value="" />
      <input type="password" name="pass" id="pass" value="" />
      <input type="submit" value="提交" id="btn"/>
      <input type="checkbox" name="checkbox" id="checkbox" value="" />兩周內(nèi)自動登錄
    </form>
    
  </body>
  <script type="text/javascript">
    var oTxt1 = document.getElementsByName('user')[0],
      oTxt2 = document.getElementsByName('pass')[0],
      cked = document.getElementsByName('checkbox')[0],
      oForm1 = document.getElementById('form1'),
      oBtn = document.getElementById('btn');
    oForm1.onsubmit = function(){
      if(cked.checked){
        alert('請注意!您已勾選自動登錄。為了保護您的賬號安全,請不要在公共電腦上這樣做。')
        setCookie('user',oTxt1.value,14);
        setCookie('pass',oTxt2.value,14);  
      }
    }
    oTxt1.value = getCookie('user');
    oTxt2.value = getCookie('pass');
  </script>
</html>

來自智能社的學(xué)習(xí)筆記延伸練習(xí)。

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論