Change icon on click (toggle)

后端 未结 6 2116
失恋的感觉
失恋的感觉 2020-12-23 10:10

I have a simple script in jquery to toggle a div (show and hide) when a

is clicked (I\'m using bootstrap).

HTML:

6条回答
  •  失恋的感觉
    2020-12-23 10:34

    $("#togglebutton").click(function () {
      $(".fa-arrow-circle-left").toggleClass("fa-arrow-circle-right");
    }
    

    I have a button with the id "togglebutton" and an icon from FontAwesome . This can be a way to toggle it . from left arrow to right arrow icon

提交回复
热议问题