I have some floated div’s and I want to select the third with jquery.
Also, after each 3 elements I have a hr tag in my html and this hr is also included by jquery in the nth-child count. Can I select only the divs and exclude the other elements inserted in html?
This is my code
$('.col:nth-child(3n)').addClass('third');
Thank you!
Try:
http://jsfiddle.net/WntR5/
And for <=IE8 (unfortunately as allways)
http://jsfiddle.net/WntR5/2/