How can I find a visible child element within a parent with jQuery?
Tried e.g. the following (and many others) which does not work.
var childelement = $("#parent").find(".child:visible");
There are many child elements within the parent, but only one is visible in the same time. All child elements are defined with the same class name.
Edit: In my code the child elements are defined to visible or invisible with the display attribute. Similar than below:
<span class="child" style="display: inline;">One</li>
<span class="child" style="display: none;">Two</li>
SOLUTION Got it work with this one:
<div class="child" style="display: inline;">One</li>
<div class="child" style="display: none;">Two</li>