<Input type="text" name="aaa" onBlur="ValidateIt(value)" /> <script language="vbscript"> sub ValidateIt(val1) if val1 mod 2 <> 0 then msgbox "It is a odd!" end if end sub </script>
function youfuncton(number) { if ( number %2 ==1) {alert("奇数");} else {alert("偶数");} }
<script language="vbscript">
sub ValidateIt(val1)
if val1 mod 2 <> 0 then
msgbox "It is a odd!"
end if
end sub
</script>
{
if ( number %2 ==1)
{alert("奇数");}
else
{alert("偶数");}
}
<input type="text" name="aaa" onKeyPress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;">
f0(val1)
{
if (val1 <= 0)
alert("aaaaa");
}</script>