Monday, May 19, 2014

Replace link href with jquery

Problem:

I have a link like 
<a id="aLink" href="http://www.deshsoft.com/">Visit</a>

I need to replace the url. I would like to see:
<a href="http://www.desherp.com/">Visit</a>
 
 
 
 
 
Solution:
 
$("#aLink").attr("href", "http://www.desherp.com/");

No comments:

Post a Comment