Accordion Menu PlusMinus change FontAwesome - Change Class Name
-
26-12-2019 - |
Question
I want to change the PlusMinus which is added by text to -> FontAwesome Icons. Would need some help with it.
The Code for Plus
$(".plusminus").text('+');
That for Minus
checkElement.parent().find(".plusminus").text("-");
Solution
Add fontawesome as reference and change your simple text +
or -
to the plus-minus icons using FontAwesome rules, like:
var content = '<span class="cnt">' + count + '</span><span class="plusminus"><i class="fa fa-plus"></i></span>';
and
checkElement.parent().find(".plusminus").html("<i class='fa fa-minus'></i>");
Demo using FontAwesome 4.0.3 : http://jsfiddle.net/IrvinDominin/779R7/
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow