For example, want to modify all href value from yahoo.com to google.com
I tried:
$("[href='http://yahoo.com']").val('http://google.com');
It won’t work, what is the correct way to do so?
Thanks.
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 wish to replace the “yahoo.com” portion of any
hrefwith “google.com”:This works by cycling through all elements that have “yahoo.com” anywhere in their
hrefattribute, and replacing that string with “google.com”.Becomes