Does this class-adding slow page rendering? Can you suggest ways of making this more efficient?  I don't want to repeat this example for all of my tags that need a class added, if there is a better way. 

$("#menu").find("div:nth-child(2), div:nth-child(3), div:nth-child(4), div:nth-child(5), div:nth-child(6), div:nth-child(7)").addClass("menuDivs");
It's slow for the following reasons:


You're using find() which is a descendant lookup. jQuery will look for all descendants under an element and see if it's a match. If the DOM under that element is huge... you get the picture.
Additionally, you aren't really specific here. You just give it div, which makes it all the more so generic. There could be lots of &lt;div&gt; under that element.


What you can do:


If these elements you have are just children of #menu, then use children() which is just  searches one level down.
If the set you have contains the elements you want plus siblings, and they are in order, then you can do slice() instead. Slice is zero-indexed by the way.

$('#menu').children('div').slice(1,6).addClass("menuDivs");



Here's a demo