<script>
function Sumar() {
var n7 = document.getElementById('txtN7').value; /*Fator tempo*/
var n8 = n7.replace(',','.');
var cem = (n8)/4; /*Calculo de fator*/
var n1 = document.getElementById('txtN1').value; /*100%*/
var n2 = document.getElementById('txtN2').value; /*101%*/
var suma = ((parseInt(n1) + parseInt(n2))*cem); /*Resultado somenta dos valores de 100 e 101*/
var n3 = document.getElementById('txtN3').value; /*95-99%*/
var n4 = document.getElementById('txtN4').value; /*85%-94%*/
var n5 = document.getElementById('txtN5').value; /*75%-84*/
var n6 = document.getElementById('txtN6').value; /*50%-74%*/
var n9 = document.getElementById('txtN9').value; /*No Match*/
var suma1 = (((parseInt(n3) + parseInt(n4)+ parseInt(n5)+parseInt(n6)+parseInt(n9))*n8)+suma);
document.write(suma1);
/* alert("Número estimado em horas: "+suma1) */
}
</script>
Good afternoon everyone !!! I need to create an "Input Text" of Html5 to print the variable suma1 of javascript. I used the document.write more by clicking the button it makes a refresh type and shows the value on a blank page. Thanks in advance!
<input type="button" onclick="Sumar();" value="Calcular Horas Tradução">