javascript - event listen for click in HTML getting the value -
Trying to reprogram a calculator using Event Listener because this code should be better overall.
and here is the code
code> var input = document.getElementById ("calculator"). AddEventListener ("click", Calc); Function calc (a) {input = this.a; Console.log (input); }
Thank you for your time
you want something like this I thought that
calc is near
event item, through which you can take the price.
function calc (a) {var input = A.target console.log (input.value); }
Edit:
After looking at Bella,
calculator turned out to be a div, do not know what you try to achieve are doing .
Comments
Post a Comment