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?
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.
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.
They use images because they know exactly how it will render on all browsers, and there is virtually zero discrepancy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With