button to new page html code example
Example 1: how to add button to open a website using html
<button onclick="window.open('http://www.example.com')">
</button>
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>
Example 3: button as href
<button onclick="location.href='http://www.example.com'" type="button">
www.example.com</button>