I want to search links and replace their rel attributes if the rel attribute currently equal attachement.
The code I have so far is:
$("href").each(function(index) {
$(this).attr('rel', 'group');
});
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.
If you’re trying to test the rel value against something (let’s say “attachment”), all you have to do is something like this:
This says that for all
<a>elements withrel="attachment", setrelto “group”.On the other hand, if what you mean to change is all elements with an
hrefattribute, you’ll use something like