I’m having issues with a jQuery query.
Consider the following (crazy) HTML example:
<!-- this is the outermost condition -->
<div id="condition">
<!-- this is a tag that I am looking for -->
<input type="text" />
<div id="condition">
<input type="radio" />
</div>
<div>
<div id="condition">
<input type="checkbox" />
</div>
<!-- this is a tag that I am looking for -->
<input type="text" />
</div>
</div>
Given the above example-markup and the outer-most condition (seen in the top), how can I get all input elements WITHIN that condition, that are not members of inner conditions as well?
I’ve provided examples so you can see which tags I want the query to return.
All html elements on a page should have a unique ID.
That said, you could do something like this:
You end up with is an
Arrayof inputs that are not wrapped in#conditionor its parent is the first#conditionelementworking example: http://jsfiddle.net/hunter/EsYLx/