I didn't read that carefully enough. YOu can't "re-enter" html in an existing html element. Here's a better revised bersion:
Code:
function addElement()
{
var ni = document.getElementById('myDiv');
var numi = document.getElementById('theValue');
var num = (document.getElementById('theValue').value -1)+ 2;
numi.value = num;
var newdiv = document.createElement('input');
var divIdName = 'my'+num+'Div';
newdiv.setAttribute('id',divIdName);
newdiv.setAttribute('type','file');
newdiv.setAttribute('name','name');
ni.appendChild(newdiv);
}
Bookmarks