javascript update href attribute code example
Example 1: change href for a tag using JS
document.getElementById("myAnchor").href = "http://www.cnn.com/";
Example 2: javascript modify href attr
link.href = link.href + '?param1=' + input.value;
document.getElementById("myAnchor").href = "http://www.cnn.com/";
link.href = link.href + '?param1=' + input.value;