去空格

function trimStr(str){return str.replace(/(^\s*)|(\s*$)/g,"");}

 或value.trim();

posted @ 2016-12-06 15:47  gong_qiang  阅读(134)  评论(0编辑  收藏  举报