Quando nel testo normale o nei tag codice c'è il tag script si blocca tutto.
codice HTML:
<!doctype html>
<head></head>
<body onload="calcola()">
<form action="#">
<label for="valore1">valore1 : </label>
<input id="valore1" type="number" name="valore1" value="10" disabled>
<label for="valore2">valore2 : </label>
<input id="valore2" type="number" name="valore2" value="1" min="1" oninput="calcola()">
</form>
<p id="risultato"><p>
<tagsctipt>
function calcola() {
let docValore1 = document.getElementById("valore1").value;
let docValore2 = document.getElementById("valore2").value;
let docRisultato = document.getElementById("risultato");
return docRisultato.innerHTML = "risultato : " + (+docValore1) * (+docValore2);
};
</tagsctipt>
</body>
</html>