Skip to content
Advertisement

javascript data set property

i have set data in the html elements like

JavaScript

and try to access them into the js file like:

JavaScript

but I got error that says cart.js:5 Uncaught TypeError: Cannot read property ‘action’ of undefined at HTMLButtonElement.

Advertisement

Answer

If you use this word, you should not use the arrow function!

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement