I would like to use JavaScript to control my CSS. At first it was thought that it was a nice little script to try different colors for my accordion menu along with different backgrounds / title / content - / ... background-colors from the input field.
I understand how to get input value using js.
I understand how CSS is controlled by getElementById(), getElementsByClassName(), getElementsByTag()and getElementsByName().
Now the problem is that my CSS looks like this:
.accordion li > a {
}
.sub-menu li a {
}
.some-class hover:a {
}
.some-other-class > li > a.active {
}
How to change the properties of such styles using JavaScript?
source
share