Atributo HTML <input> alt
Exemplo
Um formulário HTML com uma imagem que representa o botão de envio:
<form action="/action_page.php">
<label for="fname">First name:</label>
<input type="text" id="fname"
name="fname">
<input type="image" src="submit.gif" alt="Submit" width="48" height="48">
</form>
Definição e uso
O alt
atributo fornece um texto alternativo para o usuário, caso ele por algum motivo não consiga visualizar a imagem (por causa de conexão lenta, erro no atributo src ou se o usuário utilizar um leitor de tela).
Nota: O alt
atributo só pode ser usado com
<input type="image">
.
Suporte ao navegador
Attribute | |||||
---|---|---|---|---|---|
alt | Yes | Yes | Yes | Yes | Yes |
Sintaxe
<input alt="text">
Valores de atributo
Value | Description |
---|---|
text | Specifies an alternate text for the image |
❮ Tag HTML <input>