javascript - How to toggle font awesome icon on click? -
I am using the Font Awesome 'Plus' icon on list items of expandable categories when they are in extended state I have a 'zero' symbol '
HTML Jquery You can change the class of then Demo:
$ ('# category-tab took one'). Click (function () {$ (this) .next ('ul') Slide Toggle ('500');});
i element within the click code
< Code> & lt; I class = "fa-plus-circle" & gt; & Lt; / I & gt;
$ ('# category-tabs li a'). Click (function) ($ (this) .next ('ul'). Slide Toggle ('500'); $ (this) .Find ('I'). ToggleClass ('FA-Plus-Circle FA-Minus- Circle')});
Comments
Post a Comment