美文网首页
Solve the problem that input[typ

Solve the problem that input[typ

作者: yilinUnique | 来源:发表于2019-05-05 10:23 被阅读0次
<input id="fileInput" type="file" name="data" onchange="browsePic(this)" accept="image/*"/>

input在上传图片的时候,会出现不支持连续上传同一张图片的情况。解决方法:在上传完成操作之后使input的value值清空,在onchange事件和删除操作里面添加

$("#fileInput").val("");

这样不管是新增 还是 删除 ,就都可以支持上传同一张图片啦。


image.png

相关文章

网友评论

      本文标题:Solve the problem that input[typ

      本文链接:https://www.haomeiwen.com/subject/cbccoqtx.html