Expand Collapse Icon toggle issue

Hi,

I have script like below for toggle the icons, But if i click few times on the da-toggle the icons get changed for expand minus and for collapse plus. To fix this how can i improve my below code. Thanks in advance.

$(document).ready(function(){
$('[data-toggle="collapse"]').click(function (e) {
    $(e.target).find('.fa-minus, .fa-plus').toggleClass("fa-minus fa-plus");
});
});

Moving this to the JabbaScript category.

Why not get rid of the script and use a CSS toggle instead.

@felgall Thanks for the replay. If you dont mind can you please guide me how can i do that ?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.