zoukankan      html  css  js  c++  java
  • 记住图片的位置

      

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title></title>
    <script src="md5.js" type="text/javascript" charset="utf-8"></script>
    <script src="public.js" type="text/javascript" charset="utf-8"></script>
    </head>
    <body>
    <label for="">用户名:</label><input type="text" /><br />
    <label for="">密 码:</label><input type="password" /><br />
    <input type="checkbox"/>记住用户名和密码<br />
    <input type="button" value="登录" />
    <script type="text/javascript">
    var aInput=document.getElementsByTagName('input');
    if(getCookie('username') && getCookie('password')){
    aInput[0].value=getCookie('username');
    aInput[1].value=getCookie('password');
    aInput[2].checked=true;
    }
    aInput[3].onclick=function(){
    //alert(getCookie('sex'));//undefined:如果cookie值不存在输出undefined
    if(aInput[2].checked){
    addCookie('username',aInput[0].value,7);
    addCookie('password',hex_md5(aInput[1].value),7);
    }else{
    delCookie('username');
    delcookie('password');
    }
    }
    </script>
    </body>
    </html>

  • 相关阅读:
    内存相关函数
    Redis入门
    libevent(九)evhttp
    Python基础00 教程
    Python之re模块
    Makefile入门
    cmake安装jsoncpp
    awk调用date命令
    SQLite使用(二)
    SQLite使用(一)
  • 原文地址:https://www.cnblogs.com/xuxiaoxia/p/6710747.html
Copyright © 2011-2022 走看看