I am in the process of developing a Frequently Asked Questions webpage that includes around 50 questions. To avoid making the page too long, I have decided to implement collapsible divs. Below is the code snippet that I have already implemented.
My query is whether it is possible to include a hyperlink (e.g. /#question20) that can direct users to a specific div which automatically expands when clicked on the hyperlink?
Additionally, what would be the most effective method for adding expand all/collapse all buttons?
<div class="panel-group" style="width: 70%; float: right; min-width: 300px;">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><strong><a href="#collapse1" data-toggle="collapse">Question 1</a></strong></h3>
</div>
<div id="collapse1" class="panel-collapse collapse">
<div class="panel-body">Answer 1</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><strong><a href="#collapse2" data-toggle="collapse">Question 2</a></strong></h3>
</div>
<div id="collapse2" class="panel-collapse collapse">
<div class="panel-body">Answer 2</div>
</div>
</div>