Is there a way to make a form input of type image to have a rollover image?
Asked
Active
Viewed 1,001 times
3 Answers
3
Try this?
<input type="image" value="someValue" src="yourImage.gif" width="widthInPixels" height="heightInPixels" onmouseover="this.src='yourImageRollover.gif';" onmouseout="this.src='yourImage.gif';">

martincarlin87
- 10,848
- 24
- 98
- 145
-
Get rid of the `javascript:` bit. That is a label (used for breaking out of loops (and since there isn't a loop, it is a waste of bytes)), not a language declaration. – Quentin Apr 22 '11 at 16:47
-
removed the `javascript:` parts – martincarlin87 Apr 22 '11 at 16:53
2
The same way as any other image. Change the src
property when the mouseover
event fires.

Quentin
- 914,110
- 126
- 1,211
- 1,335