calc.AddEventHandler not working

Uncaught TypeError: calc.addEventListener is not a function


I don’t know what to do, please help.


document.getElementsByClassName('calc') will return a node list, which works similarly to an array. addEventListener can only be applied to a single DOM node, so if you want to apply it to all of them you will need to loop over the node list.

Do I just copy and paste the code again?