change the href value of a page using javascript code example
Example: change href for a tag using JS
document.getElementById("myAnchor").href = "http://www.cnn.com/";
document.getElementById("myAnchor").href = "http://www.cnn.com/";