Is jquery the right choice for me? I am looking to toggle the visibility of the p element when clicking on the faq-q class. How does this functionality actually work?
Here is a visual representation:
https://i.sstatic.net/n0GR1.png
html
https://i.sstatic.net/TAKVA.png
css
.faq {
flex-direction: column;
margin-top: 1.5rem;
display: flex;
}
.faq-item {
box-shadow: 0 0 1.25rem rgb(0 0 0 / 8%);
border-radius: 0.3125rem;
background: #e3eaf4;
margin-top: 1.25rem;
}
.faq-q {
padding: 0 3.125rem 0 2.5rem;
font-size: 1rem;
align-items: center;
color: #000;
height: 5rem;
margin-bottom: 0;
font-weight: 600;
cursor: pointer;
display: flex;
justify-content: space-between;
}
.faq-ans {
padding: 0 2.5rem 2.5rem;
}