<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>
时间: 2024-10-23 14:44:03