<input type=”text” placeholder=”请输入用户名” />
<input type=”password” placeholder=”请输入密码” />
<form>
<input type=”text” placeholder=”请输入用户名” />
<input type=”password” placeholder=”请输入密码” />
<input type=”password” placeholder=”请再次输入密码” />
<input type=”email” placeholder=”请输入邮箱地址” />
<button type=”submit”>注册</button>
</form>
function validateForm() {
var username = document.getElementById(“username”).value;
var password = document.getElementById(“password”).value;
var confirmPassword = document.getElementById(“confirmPassword”).value;
if (password !== confirmPassword) {
alert(“密码不一致,请重新输入!”);
return false;
}
if (username === “” || password === “”) {
alert(“用户名和密码不能为空!”);
return false;
}
return true;
}
<div id=”login-success”>
<p>登录成功,欢迎进入世界的另一个精彩角落!</p>
</div>
© 版权声明
THE END
- 最新
- 最热
只看作者