ITeye博客

去空格

mmdev · 2008-11-03 10:22 · Markdown

<input type="text" name="b" id="b"><input type="button" onclick="a()" value="去空格"/>

<script type="text/javascript">

function a(){

var str = document.getElementById('b').value;

re = / /g;

alert(str.replace(re,""));

}

</script>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。