<input type="text" id="tbox"><input id="tbtn" type="button" value="提交" onClick="checkTBox()">
<script>
function checkTBox(){
var btn = document.getElementById("tbtn")
var txt = document.getElementById("tbox")
if(txt.value == "abcdefg"){
alert("谢谢您的参与")
}else{
alert("输入错误")
}
}
</script>
</body>
<HTML><HEAD>
<TITLE>title</TITLE>
</HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function chkacc(){
alert(document.getElementById("tbxuid1").value)
alert(document.getElementById("tbxpwd1").value)
}
//-->
</SCRIPT>
<BODY>
<FORM METHOD=POST ACTION="" name="frm1">
姓名:<INPUT TYPE="text" NAME="tbxuid" id="tbxuid1">
留言内容:<INPUT TYPE="text" NAME="tbxpwd" id="tbxpwd1">
<INPUT TYPE="button" value="提交" onclick="chkacc()">
</FORM>
</BODY>
</HTML>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)