jsp中通过js去掉空格
看到有些朋友很需要jsp中去掉空格的功能,在此分享给大家
<script type="text/javascript">
function wenben() {
var inputdiv=document.getElementById("input22").value;
var aa=inputdiv.replace(/\s+/g,"");
alert(aa);
return false;
}
</script>
<input type="text" id="input22" />
<input type="button" onclick="return wenben()" value="添加" />