jquery list item class toggle

后端 未结 5 2138
悲哀的现实
悲哀的现实 2021-02-11 08:19

I have a simple function to toggle list item class from \"active\" to \"inactive\". What is the most efficient way (i.e., using the least amount of code) to set all other list i

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-11 08:43

    If SEO is not important and to use the less amount of code I would say use a radio-button list. Then you can style and interact in JavaScript by using the ":checked" selector.

提交回复
热议问题