I have encountered an issue with my structure, which looks like this:
This is how it should work: When I click on the "id contacts", the "field body" and the "field foot" should be hidden. However, the id and the field head below should remain visible so that I can click again to toggle the entire container. The field body and field foot are present multiple times on my page.
$("#Contacts> field_head").click(function(){
$("#Contacts > ...").toggle();
});
This was my suggested solution, but it did not work as expected. Another issue I am facing is that there are more ids in my structure similar to the one described above. Is there a simpler way to achieve this using this?
I am new to jQuery, so please excuse me if this question sounds naive. Additionally, there are several more of these div constructs within my webpage.