input[type=file], . .
. , , , . (: , , . . .)
, , , . , , , , . , , , .
, Chrome, Firefox IE10 : Live Example |
HTML:
<input id="theFile" type="file">
<br>Choose a file above, then either:
<br><input type="button" id="btnClone" value="Clone">
<input type="button" id="btnMove" value="Move to iframe">
<br>
<iframe id="theFrame" style="width: 99%"></iframe>
JavaScript:
(function() {
gid("btnClone").onclick = function() {
display("Here the clone:");
document.body.appendChild(gid("theFile").cloneNode(true));
};
gid("btnMove").onclick = function() {
gid("theFrame").contentDocument.body.appendChild(gid("theFile"));
display("File input moved to the iframe");
};
function gid(id) {
return document.getElementById(id);
}
function display(msg) {
var p = document.createElement('p');
p.innerHTML = String(msg);
document.body.appendChild(p);
}
})();
, - " iframe", , , . ( , .)