jquery - How to highlight a menu link when clicked?

前端 未结 4 988
春和景丽
春和景丽 2021-01-27 17:51

I have a menu with links. The links are placed inside a table. Each link is placed in a . I want to change the background color of the

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-27 18:14

    Try this:

    $(function() {
        $('td').click(function() {
            $(this).css('backgroundColor', '#EDEDED');
        });
    });
    

提交回复
热议问题