<html>
<!-- TemplateVarDefine=VDP_Var -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>发送信息</title>
<meta http-equiv="x-ua-compatible" content="ie=8">
<script language="javascript">
function test1(){
alert("1");
var b1 = document.getElementById("b1");
b1.disabled = "true";
}
function test2(){
var b1 = document.getElementById("b1").value;
//var str = ”坦克是tank的音译”;
var len = b1.match(/[^ -~]/g) == null ? b1.length : b1.length + b1.match(/[^ -~]/g).length ;
alert(len);
}
</script>
</head>
<body>
<input type="text" id="b1">
<input type="button" id="b2" value="B2 " οnclick="test2()">
</body>
</html>