<meta charset="utf-8"> <title>登陆界面</title> <script type="text/javascript
<metacharset="utf-8"><title>登陆界面</title><scripttype="text/javascript">functiontiaozhu...
<meta charset="utf-8">
<title>登陆界面</title>
<script type="text/javascript">
function tiaozhuan(){
if(username.value("yida")&&passwd.value("123")){
window.open("s.html");
}else{
window.alert("您输入的账号或密码错误!!");
}
}
function tiaozhuan1(){
window.open("login.html");
}
</script>
</head>
<body bgcolor="MintCream">
<center>
<h1>登陆界面</h1>
账号:<input type="text" name="username"/><br/>
密码:<input type="password" name="passwd"><br/>
<input type="button" value="登 陆" onclick="tiaozhuan();">
<input type="button" value="取 消" onclick="tiaozhuan1();">
</center>
</body>
</html>
哪里有错了吗 展开
<title>登陆界面</title>
<script type="text/javascript">
function tiaozhuan(){
if(username.value("yida")&&passwd.value("123")){
window.open("s.html");
}else{
window.alert("您输入的账号或密码错误!!");
}
}
function tiaozhuan1(){
window.open("login.html");
}
</script>
</head>
<body bgcolor="MintCream">
<center>
<h1>登陆界面</h1>
账号:<input type="text" name="username"/><br/>
密码:<input type="password" name="passwd"><br/>
<input type="button" value="登 陆" onclick="tiaozhuan();">
<input type="button" value="取 消" onclick="tiaozhuan1();">
</center>
</body>
</html>
哪里有错了吗 展开
2个回答
展开全部
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script type="text/javascript">
function tiaozhuan(){
var username=document.getElementById("username") //js获取元素
var passwd=document.getElementById("passwd") //js获取元素
if(username.value=="yida"&&passwd.value=="123"){ //判断
window.open("s.html");
}else{
window.alert("您输入的账号或密码错误!!");
}
}
function tiaozhuan1(){
window.open("login.html");
}
</script>
</head>
<body bgcolor="MintCream">
<center>
<h1>登陆界面</h1>
账号:<input type="text" id="username"/><br/> //设置id用于获取元素
密码:<input type="password" id="passwd"><br/>
<br/>
<input type="button" value="登 陆" onclick="tiaozhuan()">
<input type="button" value="取 消" onclick="tiaozhuan1()">
</center>
</body>
</html>
看我写的注释掉地方
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script type="text/javascript">
function tiaozhuan(){
var username=document.getElementById("username") //js获取元素
var passwd=document.getElementById("passwd") //js获取元素
if(username.value=="yida"&&passwd.value=="123"){ //判断
window.open("s.html");
}else{
window.alert("您输入的账号或密码错误!!");
}
}
function tiaozhuan1(){
window.open("login.html");
}
</script>
</head>
<body bgcolor="MintCream">
<center>
<h1>登陆界面</h1>
账号:<input type="text" id="username"/><br/> //设置id用于获取元素
密码:<input type="password" id="passwd"><br/>
<br/>
<input type="button" value="登 陆" onclick="tiaozhuan()">
<input type="button" value="取 消" onclick="tiaozhuan1()">
</center>
</body>
</html>
看我写的注释掉地方
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询