I'm trying to make a very simple javascript example but innerhtml
is not being recognized.
<!DOCTYPE html>
<html>
<head>
<title>Pagina com Javascript</title>
<script src="meujavascript.js"></script>
<!-- Versao do JS <script type="text/javascript" language="JavaScript1.8.5"></script> -->
</head>
<body>
<!--
<p id="paragrafo">texto em javascript</p>
<button type="button" onclick="mostrar()">Teste</button>
-->
<p id="valores">[valores]</p>
</br></br></br>
<button type="button" onclick=adicionar(1,2)">Mensagem</button>
</body>
</html>
javascript function:
function adicionar(parcela1, parcela2)
{
//esta função adiciona dois valores
var resultado = parcela1 + parcela2;
var test document.getElementById("valores");
test.innerhtml = resultado;
}
Very simple HTML just to practice.
My javascript example. I want to continue to practice but I do not know why the innerhtml is not working .. Can anyone help?