HTMLInputElement: alt property - Web APIs | MDN

Value

A string.

Examples

js

const inputElement = document.getElementById("imageButton");
console.log(inputElement.alt);
inputElement.alt = "A much better description";

Specifications

Specification
HTML
# dom-input-alt

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.