开发者

jquery find() combine id and html element possible?

开发者 https://www.devze.com 2023-02-01 00:05 出处:网络
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 开发

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

精彩评论

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