Is there a more elegant way of achieving the following with jQuery? Is it possible to iterate through all the children, without nesting the each
function?
$.each($('.my-class'), function () {
$.each($(this).children(), function () {
alert(this.id);
});
});
EDIT:
What if you have two or more elements with the class name my-class
, how do you iterate through all of their children?