Poniższy kod działa pod operą i firefoxem, niestety pod IE nie specjalnie. Ktoś ma jakiś pomysł?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl"> <script type="text/javascript"> function addElements(num){
var oDiv = document.getElementById("testing");
oDiv.parentNode.removeChild(oDiv);
var oDiv = document.createElement('div');
oDiv.setAttribute("name","testing");
oDiv.setAttribute("id","testing");
document.getElementById('parent').appendChild(oDiv);
for(i=0;i<num;i++){
var oInputFile = document.createElement('input');
oInputFile.setAttribute('type','file');
oInputFile.setAttribute("style","display:block");
document.getElementById('testing').appendChild(oInputFile);
}
}
<div style="width:500px;height:400px;border:1px solid red;" id="parent">