<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript">
function show(obj){
var v= obj.value.replace(/[^\x00-\xff]/g,"**");
var msg=document.all.msgId;
msg.innerHTML="文本值为:"+v+",长度为:"+v.length;
}
</script>
</head>
<body>
<input name="test" type="text" οnkeyup="show(this)"/><div id="msgId"></div>
</body>
</html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript">
function show(obj){
var v= obj.value.replace(/[^\x00-\xff]/g,"**");
var msg=document.all.msgId;
msg.innerHTML="文本值为:"+v+",长度为:"+v.length;
}
</script>
</head>
<body>
<input name="test" type="text" οnkeyup="show(this)"/><div id="msgId"></div>
</body>
</html>