How do I select elements that have a defined id? For example, within the section below I have the following:
<section>
<div class="div"></div>
<div id=""></div>
<div id="div2"></div>
<div></div>
<div id="div3"></div>
</section>
In the case above, I need to get just the 3rd and 5th div that has a valid id and not empty. How can I get this in jQuery?