解决 html input file onchang 事件触发一次后失效问题
来源:互联网 发布:淘宝客下载安装 编辑:程序博客网 时间:2024/06/05 03:50
JS:
$(function(){ $("#userFile").change(function(){ batchImportUser(); });})
function batchImportUser(){ alert(1); $("#userFile").replaceWith('<input style="opacity: 0;z-index:9999999;position: relative;left: -145px;" id="userFile" name="file" type="file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel" value="导入用户" class="sureBtn sureBtnEx marginL20"/>'); $("#userFile").on("change", function(){ batchImportUser(); }); }
HTML:
<input style="opacity: 1;z-index:9999999;position: relative;left: -145px;" id="userFile" name="file" type="file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel" value="导入用户" class="sureBtn sureBtnEx marginL20"/>
转载地址:http://blog.csdn.net/wc0077/article/details/42065193
阅读全文
0 0
- 解决 html input file onchang 事件触发一次后失效问题
- 解决input file文件chang事件只触发一次问题
- html input的file文件输入框onchange事件触发一次失效解决方法
- input 的onChang失效问题
- input file change事件只触发一次
- 关于input的file框onchange事件触发一次失效的新的解决方法
- 关于input的file框onchange事件触发一次失效的新的解决方法
- input的file框onchange事件触发一次失效的解决方法
- 关于input[type=file] change事件只能触发一次的问题
- 使用input file 通过ajax 上传文件中onChange事件只触发一次问题
- 图片上传时input file change事件多次触发解决
- 图片上传时input file change事件多次触发解决
- 解决file input 选择相同文件不触发change事件
- 【转载】解决input file 的onchange事件只生效一次的问题
- chrome下input:file无法触发click事件的问题
- INPUT[type=file]的change事件不触发问题
- 解决动态生成input无法触发click事件的问题
- 解决动态生成input无法触发click事件的问题
- rdesktop远程windows错误, 需要CredSSP
- Java基础第7讲--面向对象之类和方法
- java使用poi读取excel
- 学习Spring的第一个HelloWorld
- Centos-Docker安装
- 解决 html input file onchang 事件触发一次后失效问题
- Java多线程编程中Future模式的详解
- PHP学习记录
- Python 多线程编程 (一)
- 排序
- 软编码Flv 到Mp4 容器(十) fmp4 mvex box 讲解
- 去掉标题和沉浸式
- 证书生成
- Java多线程编程中Master-Worker模式的详解