web 开发之js---js 实现自动添加input text 编辑框
<html>
<head>
<script type="text/javascript">
function addNewLine()
{
var form=document.getElementById('form2');
var formTemp=document.createElement('form');
form.appendChild(formTemp);
var input=document.createElement('input');
var del=document.createElement('input');
del.type='button';
del.value='delete';
del.onclick=function(){form.removeChild(formTemp)}
formTemp.appendChild(input);
formTemp.appendChild(del);
}
</script>
</head>
<body>
<form id='form1'>
<input type="button" value="addNew" onclick='addNewLine()' />
</form>
<form id='form2'>
</form>
</body>
</html>
http://alzhai.com/post-374.html text input
root