Answers for "how to set href with javascript"

4

change href for a tag using JS

document.getElementById("myAnchor").href = "http://www.cnn.com/";
Posted by: Guest on April-02-2021
8

javascript set attribute href

var a = document.getElementById('myElementID');
    a.href = "http://www.mywebsite.com";
Posted by: Guest on December-04-2019
1

a href javascript

<a href="#" onclick="myJsFunc();">Run JavaScript Code</a>
Posted by: Guest on June-22-2021

Code answers related to "how to set href with javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language