I have read quite a few articles but still couldn't figure out. Tried lots of methods they provided but still no luck.
I have this in my html
<a href="report.html" class="btn btn-success btn-lg">Button 1</a>
this is what happens to css when hovered
.btn-success:hover,
.dropdown-toggle.btn-success {
background-color: yellow;
}
I want to change the background color to blue using js.
I'm not sure why you'd need to do this with js when you could just change it in your CSS. But if you must you could just add a class to the element using
And in your CSS