I'm having trouble using prev() in jQuery where it's not selecting the right element.
My HTML structure is as follows:
<section id="about">
...
</section>
<hr>
<section id="contact">
...
</section>
The "active" section is #contact. I want to select the previous section skipping over the <hr>
active = active.prev('section')
doesn't seem to be working. I think I may be reading the docs wrong...
If I take out the <hr>
everything works beautifully. Any ideas on how to skip the <hr>
on prev()?
TIA