Web effects add text input box with delete button code
<!doctype HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd" >
<html xmlns= "http://www.jzread.com/1999/xhtml" >
<head>
<meta http-equiv= "Content-type" content= "HTML; Charset=utf-8 "/>
<title> Web Effects Add text input box with delete button code </title>
</head>
<body>
<div id= "D" >
<input type= "Text"/>
</div>
<input type= "button" id= "B" value= "Add"/>
</body>
<script language= "JavaScript" >
document.getElementById ("B"). Onclick=function () {
document.getElementById ("D"). innerhtml+= ' <br><input type= ' text '/> ';
}
</script>
</html>
Method two with Delete button
<!doctype HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/ Xhtml1-transitional.dtd ""
<html xmlns= "http://www.jzread.com/1999/xhtml"
<head>
< Meta http-equiv= "Content-type" content= "HTML; Charset=utf-8 "/>
<title> Untitled document </title>
</head>
<body>
<div id=" D ">
<input type= "text" name= "Text_0"/>
</div>
<input type= "button" id= "B" value= "add"/>
</body>
<script language= "javascript"
i = 1;
document.getElementById ("B"). Onclick=function ( {
document.getElementById ("D"). innerhtml+= ' <div id= ' div_ ' +i+ ' "><input name= ' text ' name= ' Text_ ' +i+ ' "type=" text " /><input type=" button "value=" delete " onclick=" del (' +i+ ') "/></div>";
i = i + 1;
}
Function del (o) {
document.getelementbyid ("D"). RemoveChild (document.getElementById ("Div_" +o));
}
</script>
</html>