I tried to look after a similar problem but couldn't find any here. So here is my problem. I have a structure with multiple h2. Each h2 have an image inside that points to a different url. I need to fetch this url from each image and assign it to the correspondent h2.
Here is my code (this one works, but it only fetches the first link):
$("h2").each(function() {
var $link = $('a[rel=example_group]').attr("href");
$(this).append($link);
});
So I tried this:
$("h2").each(function() {
var $link = $('a[class=button zoom]').each(function(){$(this).attr("href")});
$(this).append($link);
});
but it is not working
Could you help? Thanks