how to go to another html page using button code example
Example 1: 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>
Example 2: href on a button
<button onclick="window.location.href='/page2'">Continue</button>
Example 3: button html link to another page
<input type="button" onclick="location.href='https://google.com';" value="Go to Google" />
Example 4: button html link to another page
<a href="https://google.com" class="button">Go to Google</a>
Example 5: button with href
onClick={() => {window.location.href="https://www.golfballs.com/"}}
Example 6: button html link to another page
a.button {
-webkit-appearance: button;
-moz-appearance: button;
appearance: button;
text-decoration: none;
color: initial;
}