<a href="http://www.google.com">link</a>
How do I replace link location from google.com to say “#”? $('a').attr( 'href', '#' ); isn’t 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.
It works for me.
Test code:
jQuery:
Is it possible you are trying to do this before the DOM has loaded?
Also, what browsers are you using?
EDIT:
To ensure this is only done when the DOM is loaded completely, use the document
.ready()function: