Sorry, but I found your question somewhat confusing. Is this what you want?
var parent = $("#myitem"), count = parent.children().length, index = parent.children(".theClass").index();
Gets the child index of an element with a specific class, no loop required.
However, if you need a class (but already have an index), do the following:
var parent = $("#myitem"), count = parent.children().length, classN = parent.children()[3].className;
Doug neiner
source share