applica un id ai tre campi input (es. c1, c2, c3)
poi
provalo... sono in velocitàcodice:<head> <script> function calcola() { v1 = document.getElementById('c1').value; v1 = parseInt(v1, 10); v2 = document.getElementById('c2').value; v2 = parseInt(v2, 10); document.getElementById('c3').value = v1 * v2 /100; } </script> </head> <body> ... Valore <input type="text" id="c1" > Percentuale: (senza %) <input type="text" id="c2" onkeyup="calcola()"> totale: <input type="text" id="c3"> ...
Ciao