Turki Albakr
0
Q:

js onclick redirect

// Simulate a mouse click:
window.location.href = "http://www.w3schools.com";

// Simulate an HTTP redirect:
window.location.replace("http://www.w3schools.com");
4
<button onclick="location.href='www.yoursite.com'">Click Me</button>
6
<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>
3

Tags

New to Communities?

Join the community