1 回答
TA贡献1844条经验 获得超8个赞
您的主页应将值传递给 a,session如下所示:
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<input type="email" id="valbox" class="text-box form-control" style="max-width: 200px;" placeholder="Enter Your Email Id" required>
<button type="submit" id="butval" class="btn btn-default rounded subscribe px-5 ml-4 float-left">SUBMIT</button>
</body>
<script>
$(function() {
$('#butval').on('click', function(){
let text = $('#valbox').val();
if(!text){
alert("Please enter your email")
}else{
sessionStorage.setItem("email", text);
window.location.replace("login.html");
}
})
});
</script>
</html>
然后,您的注册页面将检索它并将其设置为电子邮件输入的值:
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<input id="email" type="email" class="form-control " name="email" value="" required autocomplete="email">
</body>
<script>
$(function() {
$('#email').val(sessionStorage.getItem("email"));
});
</script>
</html>
- 1 回答
- 0 关注
- 67 浏览
添加回答
举报