IN This Code i'm Creating some dynamic Text Fields But i can't get the dynamic text fields Values .. Please anyone help me to get the dynamic Text Fields Values
function addTexfields() { document.getElementById("DivTag").innerHTML=""; //Create an input type dynamically. var RoomNo = document.getElementById('txtInventory').value; var i=0; for (i=0;i<RoomNo;i++) { var element = document.createElement("input"); var type2 = "text"; var type3 = "Textfield1"; //Assign different attributes to the element. element.setAttribute("type", type2); element.setAttribute("id", type3); var foo2 = document.getElementById("DivTag"); foo2.appendChild(element); } }
HTML PAGE
<input type="text" name="txtInventory" id="txtInventory" onkeyup="addTexfields()" />
<td><div class="cap2" id="DivTag"></div></td>