String.prototype.trim = function() {
return (this.replace(/^\s+|\s+$/g,""));
}
//调用方法
function check(){
var fn = document.getElementById("fileName").value;
document.getElementById("fileName").value = fn.trim();
}
去除首尾空格的公用方法
最新推荐文章于 2024-09-25 16:27:38 发布
1万+

被折叠的 条评论
为什么被折叠?



