Dynamic create text boxes using Javascript
- Home
- Javascript
- Dynamic create text boxes using Javascript
Dynamically create HTML textboxes, listboxes using Javascript without refreshing the page?
<html>
<head>
<title>Dynamic Form</title>
<script language="javascript">
function changeIt()
{
var i = 1;
my_div.innerHTML = my_div.innerHTML +"<br><input type='text' name='mytext'+ i>"
}
</script>
</head>
<body>
<form name="form" action="post" method="">
<input type="text" name=t1>
<input type="button" value="test" onClick="changeIt()">
<div id="my_div"></div>
</body>
Example