I've 16 different section
-tags. Every section
-tag have a data-
attribute to set a specific background-color for each section
:
<section data-color="#A3D1B5">
Now I want to set this color as the background.
What i've already tried
In this question CSS values using HTML5 data attribute say the answer, it should be possible to set the color like background: attr(data-color);
but this won't work for me...
I took a look at jQuery data()
but I don't know how to set the background for all of the section
-tags.
Any other solutions or tips how to handle this with jQuery data()
?