[jQuery] Re: Targeting nested items by class name

2008-04-17 Thread Bernhard Mager
For the first you should close the -Tags correctly with : content here content here content here $('div.car div') gives you the three div-Elements inside . With $('div.car div').click(function(event){ alert(this.className); }) you bind a function to the click event of every enclose div

[jQuery] Re: Targeting nested items by class name

2008-04-17 Thread Ariel Flesler
$('div.car div'); You should add the tagname if possible, it makes it MUCH faster. Use $('div.car > div'); if the divs need to be exactly (one level) below div.car. Please... do check the docs, it's faster for everyone: http://docs.jquery.com/Selectors Ciao -- Ariel Flesler http://flesler.blo