I'm trying to use the ":visible" and ":first-child" pseudo-selectors together in jQuery and it doesn't seem to be working out. I have the following HTML:
<div>
<a class="action" style="display:none;">Item One</a>
<a class="action">Item One</a>
<a class="action">Item One</a>
</div>
And the following jQuery call:
$("div a.action:visible:first-child").addClass("first");
But it never seems to find the right element...it finds the first element but not the first visible element. I've even tried swapping the selector order ":first-child:visible" instead of ":visible:first-child" and that doesn't work either. Any ideas?