How can I get all the <img> tags which have the same values in their src and rel attributes?
I’ve tried something like:
jQuery('img[rel=src]')
But it doesn’t appear to be working.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have to use
.filter[docs]:Note that
relis not a valid attribute forimgelements. Therefore you might want to usedata-*attributes to store the additional information.Additional note:
this.srcwill return the absolute URL, even if thesrcattribute contains a relative URL. If you want to get the actual value of the attribute, you have to use$(this).attr('src').