去除首尾空格的公用方法
String.prototype.trim = function() {return (this.replace(/^\s+|\s+$/g,""));}//调用方法function check(){var fn = document.getElementById("fileName").value;document.getElementById("fileName").value = fn.trim();} 发布时间: 2013-08-13 16:43:28 作者: rapoo
去除首尾空格的公用方法
String.prototype.trim = function() {return (this.replace(/^\s+|\s+$/g,""));}//调用方法function check(){var fn = document.getElementById("fileName").value;document.getElementById("fileName").value = fn.trim();}