Change background image of
  • on click of tag
  • 后端 未结 2 1476
    终归单人心
    终归单人心 2021-02-11 06:23

    html:

     
    • CO
    • <
    2条回答
    •  生来不讨喜
      2021-02-11 06:52

      Try this

      $("li").click(function(){
          $("li").removeClass("active");
          $(this).addClass("active");
        });
      

      CSS for the new active class is

      li.active {
         background-image: url(../images/btnSelectedTab.png);
         color: black;
      }
      

    提交回复
    热议问题