Answers for "add url redirection to button when clicking javascript"

15

javascript redirect

<script>
  window.location.href = "http://mywebsite.com/home.html";
</script>
Posted by: Guest on April-13-2020
4

how to open a new html page on button click in javascript

<button id="myButton" class="float-left submit-button" >Home</button>

<script type="text/javascript">
    document.getElementById("myButton").onclick = function () {
        location.href = "www.yoursite.com";
    };
</script>
Posted by: Guest on April-29-2020

Code answers related to "add url redirection to button when clicking javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language