Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the advantage to using images instead of actual radio inputs

What advantage could there be for Amazon to use images of radio inputs as opposed to actual <input type="radio" />? Is this a browser compatibility solution perhaps?

radio button

HTML for "button"

I have never seen <input type="image"... /> either (second line of the code). How can an image be an input?

And I threw in the javascript tag because that's what's being used to update their state.

like image 565
1252748 Avatar asked Jun 26 '13 18:06

1252748


2 Answers

The use of an image is purely for style consistency sake, as styling an input is very hard to maintain cross-browser.

Also, this particular input is not an exact replacement for a radio button, but rather Amazon is using a image submit button to gather what the user has selected. Likely, once you click on one of these options, a form is submitted or another function is triggered.

like image 78
Fillip Peyton Avatar answered Oct 23 '22 19:10

Fillip Peyton


They use images because they know exactly how it will render on all browsers, and there is virtually zero discrepancy.

like image 26
Brad M Avatar answered Oct 23 '22 17:10

Brad M