how to set href value of anchor tag in javascript code example
Example 1: get attribute value jquery href
var href = $(this).attr('href');
Example 2: get href attribute javascript
document.getElementById("link")[0].getAttribute("href");
Example 3: javascript find link by href
//Selects all links with href='http://domain.com'
document.querySelectorAll("a[href='http://domain.com']");