jQuery: finding previous div
jquery
Solution
Like this:
$('#b').prevAll('.a:first').show();
Problem
``` <div class="a" style="display:none">Content 1</div> <div class="a" style="display:none">Content 2</div> some other HTML... <span id="b">foobar</span> ``` How can I match the first div class="a" above the span id="b" to show() it? The id="b" is the only thing I know before.