Is it possible to select the last 5 child divs of an element?
Is it possible to select the last 5 child divs of an element?
Yes, you can get the div elements, and then use the slice method to get the last five:
var e = $('#someelement > div').slice(-5);
Sure, you could use the .length property of a selector to get the count, and then use the :gt(n) selector to get the last 5.
var o = $("div.container > div:gt("+($("div.container > div").length-5)+")");