Embracing buttons 03 October 2006
In his RailsConf UJS presentation, Dan was quite clear about the appropriate use of links and buttons – only use links for GETting resources – not for POST, DELETE, PUT or any other HTTP verb that implies some kind of destructive behaviour.
The problem with this however is that it requires you to litter your page with ugly forms and input buttons. However, there is a HTML element that can come to your rescue; the
Unlike submit buttons (created with the
input element) they are much more flexible in terms of what you can put in them and how you can style them. For instance, did you know you could use semantic markup inside the button?
<button type="submit">Click me <strong>now!</strong</button>