Jquery offset method for all elements in an array rather than just the first one

html, javascript, jquery, offset

Solution

You have to iterate on the divs:

$('div').each(function() {
     console.log($(this).offset());
});

Problem

I have few divs on a page with same class. I want to use jquery offset method to find offsets for all these divs. $('div').offset() returns me the offset for the first div. But, if I want offset for all the divs, is there some way to do that?

Original source