Hello, i know its a dumb question but im being unable to call my function from onclick
---
function calculoComissao() {
let valueInput = document.getElementById('calc_comissao').value
return alert(valueInput)
}
---
<div>
<input type="number" id="calc_comissao" name="name">
</div>
<button type="button" onclick="calculoComissao()"></button>
I tried using my script on a <script> tag but without any succes. Tried using this, tried async await too and so on.
Also, my variable "valueInput" is getting errors on my editor, "object is possibly null", idk if its something too..
If theres something on docs for it im sorry i didnt see it, but i can gladly read it