为什么在<input type="text"/>中
当属性onkeypress="return false;"会令到输入无效
<script>
function ignore(t){if(t.value.length<5)return true;return false;}
</script>
<input type="text" length="20" onkeypress="return ignore(this);"/>
当属性onkeypress="return false;"会令到输入无效
<script>
function ignore(t){if(t.value.length<5)return true;return false;}
</script>
<input type="text" length="20" onkeypress="return ignore(this);"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script>
function ignore(t){
if(t.value.length<5) return true;
else return false;
}
</script>
<input type="text" size="20" onkeypress="return ignore(this);"/>