String.prototype.trim = function() {
return (this.replace(/^\s+|\s+$/g,""));
}
//调用方法
function check(){
var fn = document.getElementById("fileName").value;
document.getElementById("fileName").value = fn.trim();
}
详细解决方案
除去首尾空格的公用方法
热度:240 发布时间:2013-08-13 16:43:28.0
相关解决方案