How can I access the value in (data-color) through JavaScript to store it in a variable??!
and thanks in advance
How can I access the value in (data-color) through JavaScript to store it in a variable??!
and thanks in advance
Have a look at MDN | Using data attributes. There is a section about JavaScript access.
Michael