This might be a really easy question but I would like to grab the value of the rel tag in an image and store it as a variable to be used in a photo gallery script.
Here is what I started with.
var elem = $(this),
control = $('.slides_control',elem),
total = control.children().size(),
width = control.children().outerWidth(),
height = control.children().outerHeight(),
next = 0, prev = 0, number = 0, current = 0, loaded, active, clicked, position, direction;
backgroundColor = $(img[rel])
This is just a snippit of the code but what I’m trying to do is use the rel tag to store a background color for the entire page that matches the background of the image.
Is this the right way to capture the value of the rel tag??
Thanks for any advice.
I prefer to use “attr” operator, for example :