是否可以从文件输入多个元素中删除单个值? [英] Is it possible to remove individual values from an file input multiple element?
本文介绍了是否可以从文件输入多个元素中删除单个值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图删除或以某种方式取消多个文件的单个输入中的单个值。假设我们有四个值...
I'm trying to remove or somehow nullify a single value in a single input for multiple files. Let's say we have four values...
<input id="input" multiple="multiple" type="file" />
input = document.getElementById('input');
// So our four files are:
input.files[0];
input.files[1];
input.files[2];
input.files[3];
如果我想在不破坏其他人的情况下从阵列中移除[1],我可以这样做吗?我尝试拼接,将值设置为NULL,更改名称等。这些东西似乎没有工作(而元素仍然只读= false)Jquery的删除功能删除整个元素,所以不起作用。
非常感谢任何帮助!
if I wanted to remove [1] from the array without disrupting the others, can I do it? I've tried splicing, setting the value to NULL, changing the name etc. None of this stuff seems to work (while the element remains readonly = false) Jquery's remove function removes the entire element so that doesn't work. Any help is greatly appreciated!
推荐答案
这是 readonly 。
这篇关于是否可以从文件输入多个元素中删除单个值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文