how to link a button to a section in html code example

Example 1: html button link

<button><a href='https://google.com' alt='Broken Link'>This is a button</a></button>

Example 2: html button with link

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

Example 3: link to section on page html

<!-- #top is the ID of the div where u wanna link to -->
<a href="#top">Go back to the top!</a>

<div id="top"></div>

Example 4: How to create an HTML button that acts like a link?

<button onclick="window.location.href='test.html'">Continue</button>