Answers for "change the href attribute of a link in js"

4

change href for a tag using JS

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

how to change attribute link in javascript

function changeLink(){
    document.getElementById("mylink").href = "http://facebook.com";
    document.getElementById("mylink").innerHTML = "facebook";
    }
Posted by: Guest on August-30-2021

Code answers related to "change the href attribute of a link in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language