views:

215

answers:

2

i want to use an image as reset button what code i should use in HTML and CSS ?

+2  A: 

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
ok can u tell me how to put java script ?
Muhammad Hussain
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 `<a href='...' onclick= .... `
Pekka
+1  A: 

Think this should do the trick.

 <button type="reset">
    <img src="#" alt="" />
 </button>
MiG
Good it works but it change the image shape y ?
Muhammad Hussain
It shouldn't change the shape of the image unless you specified a width/height on the image/button?
MiG
Great idea, so it can be done without JS. +1
Pekka