1.cookie实现简单的登录注册
注册功能:
<body>
用户名:<input type="text" id="uname" /></br>
密 码:<input type="text" id="upwde" /></br>
<input type="button" value="注册" id="reg">
</body>
<script>
reg.onclick = function(){
let userJson = {
"uname" : uname.value,
"upwd" : upwd.value
}
document.cookie = "userinfo"+JSON.stringify( userJson);
location.href = "login.html"
}
</script>
<body>
用户名: