var hr = $('body').find('.popup_image') hr.each(function(){ console.log($(this).attr('href') + ' ' + $(this).attr('title')); })