Skip to content

Rendering of <input type=image> that does not represent an image #9677

Open
@annevk

Description

@annevk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    a11y-trackerGroup bringing to attention of a11y, or tracked by the a11y Group but not needing response.topic: formstopic: rendering

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions