简体   繁体   中英

Remove dynamically added input file IE8

I'm trying to remove a dinamically added input type file using jquery.1.9.1 on IE8. This input is added inside a hidden form by cloning the original one.

Reference for the cloning to upload files using IFrame: Hacking a File API onto IE8

// Where file.value is an arbitrary string
var input = $('#formupload input[data-file="' + file.value + '"]');

//does nothing, the element still inside the HTML document
input.remove();

When I log or alert the result from the selector returns object .

What am I missing here? This is only for IE8, for file upload, for other browsers I'm driven in another direction.

You cannot clear a file input. You have to remove it and reiniitiate it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM