Apply function on different elements on the same page
Hello, I have this code:
- jQuery(function(){
jQuery(document).ready(function(){
jQuery.get(jQuery('a.link').attr('href'), function(rank) {
var element = jQuery('span.content' ,rank).attr('title');
jQuery('a.link').after('<span>' + element + '</span>');
});
});
});
What the code does is: the address is "a.link" will get the value that is in "span.content" and put that content in front of "a.link".
The problem is that there is on the same page more than one "a.link", although with different address.
How do I, so that the script run separately for each link?