开发者

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]'); 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜