Esiste uno script per aggiungere una text box a ogni click di un pulsante?
Ho trovato una cosa simile ma ho delle difficoltà a modificarlo. Mi potete aiutare?
<html>
<head>
<title>Script javascript: Aggiungere elementi a una pagina web</title>
<script>
function crea(){
nuovo_elemento = document.createElement("div");
nuovo_elemento.setAttribute("id","quadro"+parseInt (document.getElementById("container").childNodes.l ength+1));
nuovo_elemento.setAttribute("class","quadrato");
now= new Date();
nuovo_elemento.innerHTML=now.toLocaleString();
document.getElementById("container").appendChild(n uovo_elemento);
obj=eval("document.getElementById(\"quadro"+parseI nt(document.getElementById("container").childNodes .length)+"\")");
obj.style.height="30px";
obj.style.width="700px";
obj.style.border="1px solid red";
obj.style.margin="0px";
}
</script>
</head>
<style>
div.container{width: 700px; margin: 0px auto 0px;}
div.quadrato{border:1px solid red; height: 30px; width: 700px; margin: 0px;}
</style>
<body>
crea elemento
<div class="container" id="container"/>
</body>
</html>