2

How would I use jQuery CSS Selectors to find for instance:

css class name: "Text" which is a div inside of dom object "wrapper"?

3 Answers 3

6

$('#wrapper div.Text') or $('#wrapper .Text'), depending on how specific you want to be.

Sign up to request clarification or add additional context in comments.

Comments

1

To add to nezroy's answer: $('#wrapper > div.Text') if you only want elements directly inside the wrapper and not all that might be nested inside.

Comments

0

either

$('#wraper .text')

or

$('.text', $('#wraper'))

will work well with same results (even tho, i guess the second option is faster)

2 Comments

Could you tell me why the second option is faster?
Dunno, that's why i said I GUESS :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.