Try this one:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script type="text/javascript">
function addF() {
var x = document.getElementById('fields');
var x1 = document.createElement('input');
var x2 = document.createElement('br');
x1.type = "text";
x.appendChild(x1);
x.appendChild(x2);
}
</script>
</head>
<body>
<form id='fields' name='fields'>
<input type="text" name="txt" id='txt'><br>
</form>
<input type="button" value="add" onclick="addF();">
</body>
</html>
Bookmarks