I know that I can assign an onclick action to <input type="button"
-style buttons. But is it possible to let it behave like an <a>
without using JavaScript? I ask because I'm in a situation where technically I'm better off using <a>
's, but buttons look nicer.
views:
73answers:
2
+5
A:
You could just use CSS to make your links look like buttons.
For example: How to make sexy buttons with CSS
Justin Ethier
2010-05-17 15:08:03
+2
A:
While styling with CSS as Justin suggests is probably the better approach, the literal answer to your question is:
<form action="where-you-want-to-go.html">
<input type="submit" value="Hello">
</form>
David Dorward
2010-05-17 15:09:44
Also, set method="GET" to be sure you actually send your request as GET and not as POST.
Pim Jager
2010-05-17 15:14:04
+1 for providing the literal answer to my question. But since this workaround is rather clumsy, I think I'm better off using button-like `<a>`'s.
Pieter
2010-05-17 15:19:33
@Pim — GET is the default, there is no need to set it explicitly.
David Dorward
2010-05-17 18:52:43
Ah ok, didn't know that.
Pim Jager
2010-05-17 19:04:55