写了个例子你看下:
<script type=”text/javascript”>
function aa(){
if(document.getElementById(“shuru”).value.length>0){
document.getElementById(“xianshi”).innerHTML=”输入正确”;
}else{
document.getElementById(“xianshi”).innerHTML=”不可为空”;
}
}
</script>
</head>
<body>
<input type=”text” id=’shuru’ onblur=”aa()” /><div id=”xianshi”></div>
</body>