Toggle to open one div and close all other open divs.
I have multiple parent sections on the page. Each section has 3 child sections. Each parent toggles open and closed. and within each section there are buttons to toggle the children open and closed.
In the case of both the parents and their children, when a parent is toggled open I want the other parents to toggle closed . The same applies to the children of each parent. I want to close all the other open children when a child is toggled open. Rather like some accordions - which I can not use for this function.
This way there is only one parent and one child open at any time
Because of the number of parents and children on the page I can not use Ids. All are designated by classes
Can any one help please?