The question is exactly how do I "start" a value from within my JavaScript code so I can track whether the variable has the correct value.
I'm learning JavaScript in college and was writing a paper that takes the code down. However after some errors I decided to test one of the modules in order to verify the calculated value. But there came another problem that is not knowing how I can "start" this value in the code so that I can view in my browser.
Income tax
<h1>Cálculo do Imposto de Renda</h1>
<br>
Contribuição previdenciaria: <input type="text" name="contribuicao" id="contribuicaoId">
<br>
Despesas medicas:<input type="text" name="despesas" id="despesasId">
<br>
Número de dependentes: <input type="text" name="dependentes" id="dependentesId">
<br>
Enviar: <input type="submit" name="enviar" onclick="deducao()">
<script language="JavaScript">
function deducao(){
var dedu;
var contribuicao=parseInt(getElementById("contribuicaoId").value,10);
var despesas=parseInt(getElementById("despesasId").value,10);
var dependentes=parseInt(getElementById("dependentesId").value,10);
dedu=contribuicao+despesas+dependentes*3050;
document.write("Resposta:" +dedu);
}
</script>
</body>
</html>