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

    html:

     
    • CO
    • <
    2条回答
    •  佛祖请我去吃肉
      2021-02-11 06:46

      Create a class for what you wish the active li tag to look like; and use the following:

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

      This should affect only list items within the same ul tag.

    提交回复
    热议问题