images over actual

What is the advantage of using images instead of real radio inputs

What is Amazon's advantage in using <input type="radio" /> images over actual <input type="radio" /> ? Is this a browser compatible solution?

radio button

HTML for "button"

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

And I introduced the javascript tag because it is what is used to update its state.

+6
source share
3 answers

Using an image is intended solely for style matching, as styling input is very difficult to support cross-browser.

In addition, this particular input is not an exact replacement for the switch, but Amazon uses the send image button to collect what the user has selected. Probably, as soon as you click on one of these parameters, the form will be submitted or another function will be launched.

+6
source

They use images because they know exactly how they will be displayed in all browsers, and there is almost zero discrepancy.

+1
source

Using custom images, there is incompatibility between browsers.

Therefore, when they have a client on the phone, for example, they don’t need to figure out how the button looks in Internet Explorer compared to Google Chrome.

0
source

Source: https://habr.com/ru/post/948158/


All Articles