Foe example given
<div id="my_div">
<div>aaa</div>
<div>sss
<div id="this_is_not_straight_for_my_div">not straight</div>
</div>
<div>ddd</div>
</div>
How can select only straight childs for my_div element? Tell please this for css and for jquery also.
#my_div > divwill target only direct children of#my_div(so not the one with the long id)This uses the direct child selector that hasn’t got IE 6 support
$('#my_div > div')is the jQuery equivalentThe jQuery selector WILL work on IE6