Monday, 19 August 2013

How to create text box dynamically from javascript

How to create text box dynamically from javascript

i am trying to create the text boxes inside <div id="screens"> </div>. I
have a drop down When i select the number from dropdown. it has to create
that number of text boxes.
the javascript code i written is not working.
code:
function create(param)
{
document.getElementById("screens").innerHTML="";
for(var i = 0; i < param; i++)
{
alert(i);
document.write('<input type="text" name="Fname">');
}
}
this is adding text boxes by clearing all contents of current page. but i
want is that it should add textbox to
How can i do this?

No comments:

Post a Comment