首页 > 其他 > 详细

基础 - 验证文件类型

时间:2016-08-10 15:56:22      阅读:191      评论:0      收藏:0      [点我收藏+]
<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);
}

}
 

基础 - 验证文件类型

原文:http://www.cnblogs.com/WeWeZhang/p/5756828.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!