go to url when button clicked html code example

Example 1: onclick go to url

<input type=button onClick="opener.location='https://www.plus2net.com/'" value='Make the Main window change'>
<input type=button onClick="opener.location='https://www.plus2net.com/html_tutorial/button-linking.php'" value='Bring the button linking tutorial again'>
<input type=button onClick="location='https://www.plus2net.com/'" value='Make the current  window change'>
<input type=button onClick="self.close();" value="Close this window">

Example 2: html button click url

# Wrap whole button in a 'a' tag.
 <a href="https://google.com" class="button"><button class="pixel">Button text</button></a>