salve a tutti questo script ad ogni click crea un textbox ora io vorrei che insieme al text box venga creato anche un testo che precede il tex box, ma nn so come fare, ho provato con document.write ma nn va per favore aiuto
ecco il codice:
ecco il codice:
Codice:
<html>
<head>
<script>
var TxtCounter = 0;
function AddTextbox(parentId) {
var oTxt = document.createElement("INPUT");
oTxt.type = "text"
oTxt.name = "MyTxt" + TxtCounter++;
document.getElementById(parentId).appendChild(oTxt);
}
</script>
</head>
<body>
<form name="prova" action="prova.php" method="get">
<div id="parentId"></div>
<input type="button" name="prova" value="aggiungi" onclick="AddTextbox('parentId')">
</form>
</body>
</html>