-1

i have created textboxes dynamically in javascript it works fine. But the problem is that the textboxes is creating in blank page the below is my java script code

function testt(a){
d
for(var k=0; k<a; k++){
document.write("<br />");   

}}
function test()
{

for(var i=0; i<5; i++)
{

document.write("<input type='text' name=''>");

}
}

pleaze help me some one

Abhitalks
  • 25,725
  • 4
  • 53
  • 74
Nasir
  • 403
  • 6
  • 20

1 Answers1

0

To append textboxes you can use this code, you need to attach jQuery library, this is the easiest way.

<head>
<script>
function giveTextBox(a){
for(var k=0; k<a; k++){
    $('.container').append('<input type="text" name=""/><br/>');
}
}
</script>
</head>
<body>
<p class="container"> </p>
</body>

This should help.

RealityDysfunction
  • 2,499
  • 3
  • 22
  • 51