javascript set attribute href
snippet in javascript

javascript set attribute href

user2564

var a = document.getElementById('myElementID');
    a.href = "http://www.mywebsite.com";