Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

changeable href

<input id="input" type="url"></input>
<button id="link button"><a id="link" style="text-decoration: none; color: inherit;" href="" TARGET="_BLANK">enter</a></button>
<script src="script.js">
    var linkButton = document.getElementById("link button")
    linkButton.onclick = function(){
        var input = document.getElementById("input").value
        document.getElementById("link").setAttribute("href", "http://"+input)
    }
</script>
 
PREVIOUS NEXT
Tagged: #changeable #href
ADD COMMENT
Topic
Name
7+8 =