I'm struggling with some divs that are not behaving as expected. When I click the button, it opens and changes the text to "Collapse", but when I click it again, it doesn't change the text back to "Find Support". Additionally, if I click on a different div, it will close the open one first before opening the new one. I need all divs to close when one is clicked, and for the text to change from "Collapse" to "Find Support". Can anyone offer some guidance?
$(document).ready(function () {
$(".findButton").click(function () {
$(".findButton").val('Find Support');
$(this).val('Collapse');
$("id^=ilsList").remove();
$(this).closest($("#ilsList").appendTo($(this).parent()).slideToggle());
});
});