Sometimes you may want to use a button to link to another page or website rather than to submit a form or something like that. This is fairly simple to do and can be achieved in several ways.

How to Create an HTML Button Using the Button Tag in an A Tag

One way is to simply wrap your <button> tag in an <a> tag:

<a href=''><button>Link To freeCodeCamp</button></a>

This transforms your entire button into a link.

A second option is to create your link as you normally would with your <a> tag and then style it via CSS:

<a href=''>Link To freeCodeCamp</a>

Once you’ve created your link, you can the use CSS to make it look like a button. For instance, you could add a border, a background color, some styles for when the user is hovering the link.

You can read more about styling links with CSS here.

How to Put a Button inside a Form Using HTML

Another way to add a button is to wrap an input inside form tags. Specify the desired target URL in the form action attribute.

<form action="">
    <input type="submit" value="Go to Google" />

I hope you've found tutorial helpful. Happy coding.