I currently have the following html:
Apologies for edit, I was not paying attention when i wrote this.
<div class ="left">
<div>1</div>
<div>2</div>
<div>3</div>
</div>
I am using the JQuery .each command to iterate through each div using $('div').each
. Although I only want to iterate through the divs inside the div with the class name 'left'.
I have tried using $('.left > div').each
but it did not work.
Any help appreciated.
Is this what you're lookng for?
$('div.left>div').each(function(){ /* do stuff */ });
Fiddle: http://jsfiddle.net/MLnBY/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With