Quote Originariamente inviata da maxpowerweb Visualizza il messaggio
<html>
<body>
<form>
<input type="text" name="primo" id="primo" size=17>
<input type="text" name="secondo" id="secondo" size=17></br>
<input type="checkbox" name="tipo1" id="tipo1" value="terzo" />terzo</br>
<input type="checkbox" name="tipo1" id="tipo2" value="quarto" />quarto</br>


</form>
<p>Click the button to alert the contents of the text area.</p>


<button type="button" onclick="myFunction()">Try it</button>
<br>
<textarea id="cia">
</textarea>


<script>
function myFunction() {


var x = document.getElementById("primo").value;
document.getElementById("cia").innerHTML = "Prova: " + x ;
var y = document.getElementById("secondo").value;
document.getElementById("cia").innerHTML = "Prima: " + y ;


}
</script>


</body>


</html>
utilizza il tag code per il codice (2 avvertimento)

come ho scritto devi aggiungere alla variabile. tu sovrascrivi