I have a FAQ page where I am trying to get a certain answer to show when a certain question is clicked.
Here is a fiddle: http://jsfiddle.net/hdr6shy9/
Here is the code:
HTML:
<div class="questions">
<div>First Question</div>
<p>Answer to first questions</p>
<div>Second Question</div>
<p>Answer to second Question</p>
<div>Third Question</div>
<p>Answer to third question</p>
</div>
CSS:
.questions div{
cursor:pointer;
margin:10px 0;
}
p{
display:none;
background-color:#f4f4f4;
padding:10px;
}
I want the p to show according to the correct div question that is clicked. Any help? Thanks