jquery find() combine id and html element possible?
just wondering:
in CSS I can access a div through
#display div
is there a similar way in Jquery. I need to find the DIV with id="displayFirst" (a page) and from within this DIV the div with 开发者_StackOverflow中文版data-role=content. Something along the lines of:
.find('#displayFirst', 'div[data-role=content]'));
Thanks,
Frequent
Just use a space (the descendant selector) as your current selector does (just like CSS):
$('#displayFirst div[data-role=content]');
the same applies when using .find()
:
.find('#displayFirst div[data-role=content]');
精彩评论