Answers for "html button onclick redirect"

7

html button redirect

For button redirection you can use below code:

Using these two type <button> and <input> tag:

<a href="http://www.google.com/">
   <button>Visit Google</button>
</a>
  
or:

<a href="http://www.google.com/">
   <input type="button" value="Visit Google" />
</a>
  
<!--
I hope it will help you.
Namaste
-->
Posted by: Guest on June-14-2020
7

js onclick redirect

<button onclick="location.href='www.yoursite.com'">Click Me</button>
Posted by: Guest on June-16-2020
50

javascript redirect button

window.location.href = "http://mywebsite.com/home.html";
Posted by: Guest on July-18-2019
0

onclick redirect to url

<td onclick="javascript:window.location.href-'http://www.stackoverflow.com'" style="cursor:hand">Stackoverflow</td>
Posted by: Guest on September-01-2021
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
9

html button redirect

You can make <button> tag to do action like this:

<a href="http://www.google.com/">
   <button>Visit Google</button>
</a>
or:

<a href="http://www.google.com/">
   <input type="button" value="Visit Google" />
</a>
It's simple and no javascript required!
Posted by: Guest on June-12-2021

Code answers related to "html button onclick redirect"

Code answers related to "Javascript"

Browse Popular Code Answers by Language