how to pass this element to javascript onclick function and add a class to that clicked element

前端 未结 6 2086
长情又很酷
长情又很酷 2021-01-30 19:21

I had an html navigation code as below

6条回答
  •  别跟我提以往
    2021-01-30 20:01

    Try like

    
    

    For the class selector you need to use . before the classname.And you need to add the class for the parent. Bec you are clicking on anchor tag not the filter.

提交回复
热议问题