Html – Getting 'undefined' or 'NaN' for data-addval when trying to get is as number in JS
I'm building a simple web game and I've been struggling with a problem for hours. No matter how I try to access the data-addval attribute in my JavaScript code, it always returns 'undefined' or 'NaN' when it should be a…