初学JavaScript|JS密码登陆
<html>
<head>
<title>JavaScript Demo 2</title>
<script type="text/javascript">
function show()
{
var test1
test1=document.getElementById("test1").value
if (test1 == "123456")
{
view = "密码正确!";
alert(view);
}
else{
alert("密码错误!");
}
}
</script>
</head>
<body>
<form onsubmit="return show()">
<input type="text" id="test1" value=""></input>
<input type="submit" value="登陆"></input>
</form>
</body>
</html>
版权声明:若无特殊注明,本文皆为《
CM部落 》原创,转载请保留文章出处。
本文链接:初学JavaScript|JS密码登陆 https://www.itkz.cn/note/34.html
正文到此结束





发表吐槽
你肿么看?
既然没有吐槽,那就赶紧抢沙发吧!