How to Make an Input Button a Hyperlink
HTML Input buttons are form items that are generally used to perform a Submit action to process the form with which it is associated. They also can be used to create a hyperlink for redirecting your site user. This is useful when you want something more prominent than a text hyperlink. Use JavaScript in the Input button to create a hyperlink.
Instructions
-
-
1
Open the Web page in a text editor or HTML editor of your choice. Locate the button you want to modify.
-
2
Type the following "onClick" code to create the hyperlink, substituting link destination and value for the example text:
<input type="button" onClick="window.location='http://www.example.com/example'" value="Example">
-
-
3
Save the Web page. Open the page in an Internet browser to test the hyperlink button.
-
1
Resources
- Photo Credit Thinkstock Images/Comstock/Getty Images