[查看演示] 源码如下 ---------------------------------------------------------- <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>html-www.51windows.Net</title>
</head>
<body>
<form name="free"method="POST"action=""onsubmit="return check()">
<p align="center">
<input type="text"name="t1"size="20">
<input type="submit"value="提交"name="B1">
</p>
</form>
<script LANGUAGE="javascript">
<!--
function check()
{
if(document.free.t1.value.length==0){
alert("输入框不能为空!");
document.free.t1.focus();
return false;
}
}
//-->
</script>
</body>
</html>
<div style="position: absolute; top: 10; right: 10; width: 148; height: 18;cursor:hand">
<input type="button" name="Button" value="查看源代码" onClick= 'window.location = "view-source:" + window.location.href'></div> |