<!DOCTYPE html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
<title>untitled</title>
<script type="text/javascript">
function testContent(obj){
    if(document.getElementById(obj).value.length==0){
        alert('不能为空');return false;
        }
    }
</script>
</head> 
<body> 
<form name="search" method="post" action="">
<input name="input" id="test">
<input type="button" name="go" value="goSearch" onClick=" return testContent('test')">
</form>
</body> 
</html>

 

相关文章:

  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
  • 2022-12-23
猜你喜欢
  • 2021-10-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-09
相关资源
相似解决方案