I am currently working on creating an interactive FAQ accordion with specific features in mind: 1- Only one question and answer visible at a time (I have achieved this) 2- When toggling the open question, it should close automatically (having trouble with this)
Check out this CodePen link for a preview of what I've accomplished so far: https://codepen.io/simokitkat/pen/yLEONpo?editors=0010
Here is the HTML code snippet:
<div class="text">
<h1>FAQ</h1>
<ul>
<li>
<div class="question">
<h2>How many team members can I invite?</h2>
</div>
<p>You can invite up to 2 additional users on the Free plan. There is no limit on team members for the
Premium
plan.
</p>
</li>
<li>
<div class="question">
<h2>What is the maximum file upload size?</h2>
</div>
<p>No more than 2GB. All files in your account must fit your allotted storage space.</p>
</li>
<!--Additional list items here-->
</ul>
</div>