tags:

views:

73

answers:

2

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.

+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
+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
Also, set method="GET" to be sure you actually send your request as GET and not as POST.
Pim Jager
+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
@Pim — GET is the default, there is no need to set it explicitly.
David Dorward
Ah ok, didn't know that.
Pim Jager