本文主要包含local store,dls dead local store,localappstore,local dollar store,mui等相关知识,教程希望在学习及工作中可以帮助到您
");
</div>
mui 使用LocalStore记住用户密码方法示例
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <title></title>
- <script src="js/mui.min.js"></script>
- <link href="css/mui.min.css" rel="stylesheet" />
- <script type="text/javascript" charset="utf-8">
- mui.init();
- </script>
- <style>
- body {
- margin-left: 500px;
- }
- fieldset {
- width: 380px;
- height: 220px;
- text-align: center;
- }
- #txtId,
- #txtPwd {
- width: 240px;
- margin: 10px auto;
- }
- </style>
- </head>
- <body>
- <fieldset id="">
- <legend>用户登录</legend>
- 用户名:<input type="text" id="txtId" /><br />
- 密码:<input type="password" id="txtPwd" /><br />
- <input type="checkbox" id="chkRem" />记住密码<br />
- <input type="button" value="登录" onclick="remPwd()" />
- </fieldset>
- <script type="text/javascript">
- var Id = localStorage.getItem("txtId");
- if(Id != null) //如果缓存中有数据,则加载出来 B5教程网
- {
- document.getElementById("txtId").value = Id;
- document.getElementById("txtPwd").value = localStorage.getItem("txtPwd");
- document.getElementById("chkRem").checked = "checked";
- }
-