<html xmlns="http://www.w3.org/1999/xhtml&...
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>提交</title>
</head>
<body>
<form id="form1" runat="server" action="WebForm25.aspx" onsubmit="return form1Submit();"> <div> <label> 姓名: <input id="nameInput" type="text" /> </label> <input type="submit" value="提交" /> </div></form><script type="text/javascript"> function form1Sumbit() { var nameInput = document.getElementById("nameInput"); if (nameInput.value == "") { alert("【请输入姓名】!"); nameInput.focus(); return false; } }</script>
</body>
</html>
为啥不出弹框呢?求解
神不在的星期二
相关分类