Keep button in active state until clicked upon again

前端 未结 3 1729
太阳男子
太阳男子 2021-01-20 03:02

I feel like I have a relatively simple question that I\'m just not sure how to go about doing. I have an html input tag of button type which calls a javascript onclick funct

3条回答
  •  花落未央
    2021-01-20 03:58

    It seems that you need toggle functionality.

    Please try with jQuery toggleClass() function: http://api.jquery.com/toggleclass/

提交回复
热议问题