日期:2014-05-16 浏览次数:20378 次
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>无标题文档</title>
<script type="text/javascript">
window.onload=function()
{
var oForm=document.getElementById("zhuce")
var oInput=oForm.document.getElementsByTagName("input")
var oSpan=oForm.document.getElementsByTagName("span")
for(var i=0;i<oInput.length;i++)
{
if(oInput[i].value=="")
{
oInput[i].onblur=function()
{
for(var j=0;j<oSpan.length;j++)
{
document.getElementById().innerHTML="不能为空"
}
}
}
else
{
document.getElementById().innerHTML="填写正确"
}
}
}
</script>
</head>
<body>
<form id="zhuce" action="#" method="post">
<input type="text" /><span></span><br />
<input type="text" /><span></span><br />
<input type="text" /><span></span><br />
<input type="text" /><span></span><br />
<input type="text" /><span></span><br />
<input type="text" /><span></span><br />
</form>
</body>
</html>
<script type="text/javascript">
window.onload = function () {
var oForm = document.getElementById("zhuce");
var oInput = oForm.getElementsByTagName("input");
var oSpan = oForm.getElementsByTagName("span");
for (var i = 0; i < oInput.length; i++) {<