答案:<html>
<head>
</head>
<body>
<p> </p>
<script language=vbscript>
function VBTrimStr(temStr)
VBTrimStr=trim(temStr)
end function
</script>
<script language=javascript>
function TrimStr(temStr){
return VBTrimStr(temStr)
}
</script>
<form name=fmTest>
<input type=text name=txtTest>
<input type=button name=btnOk value=ok>
</form>
<script language=javascript for=btnOk event=onclick>
var getStr=document.fmTest.txtTest.value
alert("*" + getStr + "*")
getStr=TrimStr(getStr)
alert("*" + getStr + "*")
</script>
</body>
</html>
上一个:诶,我来修改一下吧
下一个:用纯CSS作按钮Good