I am trying to update the css of my navbar using jQuery.
Where you would normally define the css as:
.navbar-static-top .navbar-nav > .active > a{
background-color: black;
}
What do I use for the class selector (without typing each element individually)?
$(".navbar-static-top .navbar-nav > .active > a").css({"background-color": "black"});
css()should be avoided wherever possible.a/span/divetc if they are way to much nested as in this case!addClass()and make sure the CSS rule is specific enough to override any existing stylig on the element.