views:

193

answers:

3

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

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

+5  A: 

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

nezroy
+1  A: 

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.

CodeMonkey1
A: 

either

$('#wraper .text')

or

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

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

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