HTML <input> alt-eigenschap
Definitie en gebruik
alt
De eigenschap biedt de gebruiker alternatieve tekst als hij/zij de afbeelding niet kan bekijken vanwege een bepaalde reden (bijvoorbeeld een trage verbindingssnelheid, een fout in de src-eigenschap, of als de gebruiker een schermlezer gebruikt).
Note:alt
Eigenschappen kunnen alleen worden toegewezen aan <input type="image"> used together.
Note:even alt
The attribute is not a required attribute, but it should still be set when the input type is image. If this attribute is not used, it may cause usability issues for text browsers or non-visual browsers.
Example
HTML form with an image representing the submit button:
<form action="/action_page.php"> <label for="fname">Name:</label> <input type="text" id="fname" name="fname"> <input type="image" src="submit.gif" alt="Submit" width="48" height="48"> </form>
syntax
<input alt="text">
attribute value
value | description |
---|---|
text | Specify the alternative text for the image. |
Browser support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |