Alex Rivera | Logout

How to make an input type=button act like a hyperlink and redirect using a get request?

Asked 2010-07-21T20:45:02.333
172

How do I make a <input type=button> act like a hyperlink and redirect using a GET request?

Edit
Report

1 Answer

190

You can make <button> tag to do action like this:

<a href="http://www.google.com/">
   <button>Visit Google</button>
</a>

or:

<a href="http://www.google.com/">
   <input type="button" value="Visit Google" />
</a>

It's simple and no javascript required!


NOTE:

This approach is not valid from HTML structure. But, it works on many modern browser. See following reference :

answered 2013-02-26T15:30:48.010

Your Answer