set attribute href vanilla js code example
Example: javascript set attribute href
var a = document.getElementById('myElementID');
a.href = "http://www.mywebsite.com";
var a = document.getElementById('myElementID');
a.href = "http://www.mywebsite.com";