Please I have 4 divs nested in a div, now each of this four div have a button in my JavaScript code I mapped through the buttons usinh the forEach loop and each of the buttons listens to a click event,when I click the button attached to a particular div it toggles to show a hidden details and when i click it again it toggles to hide it, now my problem is when i click the button for a particular div the other divs toggles but do not display to hidden details, however i want a situation where if i click a button attach to a particular div i want only that div to toggle and show the hidden content while the other div do not react except their button is clicked , please how do i achieve this
Well I have tried rewriting the codes and I keep getting same result
Jennifer Okoroji is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.