So, what you are essentially stating is to add styling to my style sheet already attached with the specific color then. That would work, but I still would like to know how to perform this JS.
W3 had created id’s to the H1, p, and, other tags, then used the code I showed to change the color.
What is the issue with assigning classes to colors? I had to do this to style my buttons. Many do not like it, but sometimes it is necessary, under the right circumstances, right?