JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css">
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
<div data-role="collapsible-set">
<div data-role="collapsible" class="openMe">
<h3>Hello 1</h3>
<p>I'm the collapsible content. By default I'm closed, but you can click the header to open me.</p>
</div>
<div data-role="collapsible" class="openMe">
<h3>Hello 2</h3>
<p>I'm the collapsible content. By default I'm closed, but you can click the header to open me.</p>
</div>
<div data-role="collapsible" class="openMe">
<h3>Hello 3</h3>
<p>I'm the collapsible content. By default I'm closed, but you can click the header to open me.</p>
</div>
</div>
<br />
<a href="#" data-role="button" id="openAll">Open All Collapsible</a>
<a href="#" data-role="button" id="closeAll">Close All Collapsible</a>
JavaScript
$('#openAll').on('click', function() {
$('.openMe').each(function() {
var coll = $(this);
coll.trigger('expand');
});
});
$('#closeAll').on('click', function() {
$('.openMe').each(function() {
var coll = $(this);
coll.trigger('collapse');
});
});