基础

<input id="show" type="file" />


window.onload = function () {

var oShow = document.getElementById("show");
oShow.onchange = function () {

var filePath = this.value;
var suxPath = filePath.substr(filePath.lastIndexOf(".")+1).toUpperCase();
console.log(suxPath);
}

}
 
原文地址:https://www.cnblogs.com/WeWeZhang/p/5756828.html