<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<form action="dm.html" method="post" οnsubmit="return shw();">
<input type="text" name="hh" id="hh"/>
<input type="submit" />
</form>
</body>
<script>
function shw()
{
var s= window.document.getElementById("hh").value;
//alert(s);
if(s=="0")
{
alert('ok'+s);
return true;
}
else
{
alert('faile');
return false;
}
}
</script>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<form action="dm.html" method="post" οnsubmit="return shw();">
<input type="text" name="hh" id="hh"/>
<input type="submit" />
</form>
</body>
<script>
function shw()
{
var s= window.document.getElementById("hh").value;
//alert(s);
if(s=="0")
{
alert('ok'+s);
return true;
}
else
{
alert('faile');
return false;
}
}
</script>
</html>