how to make a button link to another page in html code example

Example 1: html button with link

<a href="https://www.google.com">
  <button>Go to Google</button>
</a>

Example 2: how to make links in html

<a href="link.html"> text link </a> <!-- link to html -->
<a href="google.com" URL> Google </a> <!-- link to site -->
<a href="link.html"><button> Link </button></a> <!-- Button link -->

Example 3: add link behind a button in html

<!DOCTYPE html>
<html>
   <head>
      <title>Title of the document</title>
   </head>
   <body>
      <form>
         <input type="button" onclick="window.location.href = 'https://www.w3docs.com';" value="w3docs"/>
      </form>
   </body>
</html>

Example 4: button html link to another page

<input type="button" onclick="location.href='https://google.com';" value="Go to Google" />

Example 5: a href to other site

<a href="https://examplesite.com" target="_blank" rel="noopener noreferrer">
  Example Link
</a>

Example 6: linking external pages html

<a href="https://www.w3schools.com/html/">Visit our HTML tutorial</a>