Skip to content
Advertisement

Bootstrap Accordion – Toggle all nested elements

I have a lot of nested bootstrap collapsible elements on a page. As example http://jsfiddle.net/JPgLT/7/

How can i set a link to toggle all elements only within the parent element?

JavaScript

Advertisement

Answer

You could add a special class closeall to the buttons, and then toggle the collapse state using jQuery..

JavaScript

Bootstrap 3 Demo: https://codeply.com/p/g0vquJl0Xn

Related questions
bootstrap 3 collapse(‘hide’) opens all collapsibles?

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement