I'm just starting to learn jQuery and I'm working on changing the font icon class when clicked to display a drop down. Right now, it changes the icon and drops down the content as expected. However, I'm facing an issue where I want the icon to toggle back when clicked again, but only the text toggles while the icon remains the same. Here is my current code snippet:
$(".answer1").hide();
$(".question1").on("click", function(){
$(".answer1").toggle(300);
$(this).find($(".fa")).removeClass('fa-plus').addClass('fa-minus');
});
Any suggestions or advice on how to achieve this?