How to make a button link to another page in HTML
A sample output using the two different tags is shown below. In order to open the link in a new window, the window.open method is used.
Note: This method requires JavaScript to be enabled in your browser.
Method 2: Using the <form> tag
The action attribute in the <form> tag can be used to specify the URL to send the form data to upon submission.
Note: Since
formactionis an HTML5 specific feature, it may not always work as expected on older versions of popular browsers like Chrome and Safari. In some cases, a trailing question mark(?) is added at the end of the URL by default.
Method 3: Using the <a> tag
The href attribute can be used to add the link to a text and the <a> tag can then be stylized with CSS to look like a button as shown below:
Free Resources
Copyright ©2025 Educative, Inc. All rights reserved