日期:2014-05-20 浏览次数:20831 次
<script>
function test()
{
var a1 = document.getElementById("aa").value.length;
var b1 = 4;
if (a1 > b1);
{
alert("對不起!碼長度不能大於4位數");
}
return false;
document.write(a1);
}
</script>
<input name="aa" id="aa" type="text" value="abcd" onblur="test();" />