<button onclick="funcion6();">
Dame click!
</button>
<p id="demo6">Yo cambiare al darle click</p>
<script>
function funcion6(a,b) {
return a + b;
}
document.getElementById('demo6').innerHTML = funcion6(2,3);
</script>
This already worked for me.
<button onclick="document.getElementById('demo5').innerHTML = funcion5(8,9);">Click para hacer la pinshi suma</button>
But I'm looking for a way to do it without putting so much code in the on-click method. I hope you can help me, thank you.