Update css using jQuery

前端 未结 2 1879
挽巷
挽巷 2021-01-24 19:55

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{
         


        
相关标签:
2条回答
  • 2021-01-24 20:10

    You can use below js to apply css.

    jQuery(".navbar-static-top .navbar-nav").find(".active").children("a").css("background-color","#000000");
    

    I hope this code is useful for you.

    0 讨论(0)
  • 2021-01-24 20:12

    try out using find

    jQuery(".navbar-static-top .navbar-nav").find(".active").find("a").css("background-color","#000");
    

    Thanks !

    0 讨论(0)
提交回复
热议问题