i want to use an image as reset button what code i should use in HTML and CSS ?
Asked
Active
Viewed 1.5k times
2 Answers
7
Think this should do the trick.
<button type="reset">
<img src="#" alt="" />
</button>

Hux
- 3,102
- 1
- 26
- 33
-
It shouldn't change the shape of the image unless you specified a width/height on the image/button? – Hux Jan 03 '10 at 10:42
4
Good question. Can't be done AFAIK. Images can only serve as submit buttons.
You would have to use Javascript to do a onclick="this.form.reset()"
on a normal image, or style a normal reset button using a background image (should be possible without problems).

Pekka
- 442,112
- 142
- 972
- 1,088
-
Check out MiGs approach, it works without JS and you just have to style the button. The Javascript I quote above you would just put into the image tag ` – Pekka Jan 03 '10 at 10:45