I'd like to reveal only post titles on my blog posts loop, and when the title is clicked -- the excerpt will appear below.
So far I got this:
$("#postTitle").click(function () {
$("#postExcerpt").toggle();
Which works one the first result only.
This, however:
$("#postTitle").click(function () {
$("#postExcerpt").next().toggle();
Doesn't work at all, and I can't figure out why.
My loop looks like this:
<div class="box">
<div class="block">
<p id="postTitle"><a href="#">Post Title</a></p>
<p id="postExcerpt" style="display:none;">Post Excerpt</p>
</div>
</div>
Your help is appreciated!