Reputation: 7233
I have this html:
<div id="outer">
<div id="inner">...</div>
</div>
In Prototpye I could just use that code to select the inner div by id:
$('#outer #inner');
How would I do that in jQuery? I tried the same selector, but it did not work.
Thanks!
Upvotes: 1
Views: 2595
Reputation: 128791
$('#outer #inner');
Is already valid in jQuery and would select the #inner
descendant of #outer
.
You could also use:
$('#outer > #inner');
$('#outer').find('#inner');
$('#outer').children('#inner');
Upvotes: 5