English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Die input alt Eigenschaft, wenn aus irgendeinem Grund (wegen langsamer Verbindung, Fehler im src-Attribut oder wenn der Benutzer einen Screenreader verwendet) das Bild nicht angezeigt werden kann, bietet der alt-Attribut dem Benutzer einen alternativen Text. Das alt-Attribut kann nur mit <input type=image> verwendet werden.
HTML-Formular, submit verwendet ein Bild als "Submit"-Schaltfläche:
<!DOCTYPE html> <html> <head> <title>HTML: <input> alt Attribut - Grundlegende Anleitung (oldtoolbag.com)</title> <body> <form action="action_page.php"> Vorname: <input type="text" name="fname"><br> <input type="image" src="submit.gif" alt="Submit" width="48" height="48"> </form> <p>Click the image, the input will be sent to the page named "action_page.php" on the server.</p> <p>Notice: The default behavior of the image input type is to send the X and Y coordinates of the click to the server if the image button is activated.</p> </body> </html>Test and see ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the alt attribute.
If the image cannot be displayed for some reason (due to slow connection, incorrect src attribute, or user using a screen reader), the alt attribute provides the user with alternative text.
Note: The alt attribute can only be used with <input type ="image">.
None.
<input alt="text">
Value | Description |
---|---|
text | Specify alternative text for images. |