Open
Description
https://html.spec.whatwg.org/multipage/rendering.html#images-3 is not exactly clear on what "alternative text" is. Presumably it just means the alt
attribute as the input
element section doesn't really detail anything else.
However in practice user agents at least fallback to the value
attribute when the alt
attribute is not there and Chromium and WebKit also seem to include the title
attribute in that chain (preferring that to value
).
You can use this example and add/remove attributes to get a feeling of what happens in different user agents:
data:text/html,<input alt="1" title="2" value="3" type="image" style="background-image: url('data:image/gif;base64,R0lGODdhAgACAIABAAAAAP///ywAAAAAAgACAAACA0QCBQA7')">
Also note how when you use the empty string Chromium and Gecko render nothing, but WebKit falls back to "Submit".
cc @whatwg/a11y