javascript attribute href set code example
Example 1: get href attribute javascript
document.getElementById("link")[0].getAttribute("href");
Example 2: jQuery change href value
$("#someAnchorElement").attr("href", "http://www.myfancynewurl.com");