Change icon on click (toggle)

后端 未结 6 2162
失恋的感觉
失恋的感觉 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:28

    Instead of overwriting the html every time, just toggle the class.

    $('#click_advance').click(function() {
        $('#display_advance').toggle('1000');
        $("i", this).toggleClass("icon-circle-arrow-up icon-circle-arrow-down");
    });
    

提交回复
热议问题