<div id="xid">
<div id="one">1</div>
<div id="two">2</div>
<span id="aspan"></span>
<div id="three">3</div>
<img src="" />
<div id="four">4</div>
</div>
$('div#xid > div:nth-of-type(3)');
this should match the div id="three" but it doesnt. it just breaks on the span and returns nothing.