且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从Internet Explorer中的文件输入中只获取文件名

更新时间:2022-10-15 12:03:25

You can try this

var path = document.getElementById("whatever").value;
var fileName = path.match(/[^\/\\]+$/);
console.log(fileName);