<input type="text" name="w" size="20"><input type="submit" name="B1" onclick="alert(w.value.replace(/[^\x00-\xff]/g,'**').length)">这个是字节长<input type="text" name="w" size="20"><input type="submit" name="B1" onclick="alert(w.value.length)">这个是字符串长
调试欢乐多
function check() {
if(document.a.vlaue.length < 3){
alert("你的密码长度少于3");
return false;
}
}
</script><input type="text" name="a" size="20"><input type="button" name="B1" onclick="check()">
这个我也试过,是不行的,反正一构造函数来做就不行。
大家帮忙看看啊。