【问题标题】:Clearing the input file field after reselecting [duplicate]重新选择后清除输入文件字段[重复]
【发布时间】:2018-06-13 04:13:12
【问题描述】:

我想在每次删除或选择文件时从输入文件多个字段中清除数据,因为当我再次选择文件时,旧文件仍然存在。

<input type="file" name="files" multiple />

【问题讨论】:

  • $(selector).val('');

标签: jquery


【解决方案1】:

将类(类似于“toEmpty”)添加到您的输入中,并使用$("toEmpty").val("");在特定动作(按钮单击或其他)上清除它们

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-21
    • 2022-01-12
    • 2018-01-08
    • 2015-07-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多