English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Manual de referencia HTML

大全 de etiquetas HTML

HTML: <input> atributo src

El atributo src del elemento <input> especifica la URL de la imagen que se utiliza como botón de envío, el atributo src es obligatorio para <input type ='image'> y solo se puede usar con <input type ='image'>.

 HTML <input> etiqueta

Ejemplo en línea

Un formulario HTML que contiene una imagen que representa el botón "submit":

!DOCTYPE html>
<html>
<head>
<title>HTML: <input> atributo src - Sitio web de tutorial básico(oldtoolbag.com)</title>
<body>
<form action="action_page.php">
  Nombre: <input type="text" name="fname"><br>
  <input type="image" src="submit.gif" alt="Submit" width="48" height="48">
</form>
</html>
Prueba para ver ‹/›


Al hacer clic en la imagen, los datos se enviarán a la página llamada “action_page.php” en el servidor.
Nota: El tipo de entrada de imagen activa por defecto el envío de las coordenadas X e Y del clic en el botón de imagen.

Compatibilidad con navegadores

IEFirefoxOperaChromeSafari

Todos los navegadores principales admiten la propiedad src.

Definición y uso

El atributo src especifica la URL de la imagen que se utiliza como botón de envío.

Nota: src atributo para<input type ='image'> es obligatorio y solo se puede usar con<input type ='image'> se utilizan juntos.

HTML 4.01 y HTML5Las diferencias entre

Ninguna.

Sintaxis

<input src="URL">

Valor del atributo

ValorDescripción
URLEspecifica la URL de una imagen como un botón de envío.
Valores posibles:
URL absoluta - Se refiere a otro sitio web (por ejemplo, SRC =“http:)//www.example.com/submit.gif”)
URL relativa - Se refiere a un archivo dentro de un sitio web (por ejemplo, SRC =“submit.gif”)
 HTML <input> etiqueta