Answers for "on button click redirect to another page with id"

4

how to redirect on button click in html

<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
0

redirect on pressing button

<button onclick="location.href = 'www.yoursite.com';" id="myButton" class="float-left submit-button" >Home</button>
Posted by: Guest on August-03-2021

Code answers related to "on button click redirect to another page with id"

Browse Popular Code Answers by Language