Area altAtributo
Objeto Area
Definición y uso
El atributo alt devuelve o establece el valor del atributo alt de un área.
El atributo alt especifica el texto alternativo que se mostrará cuando el navegador no pueda mostrar un área.
Sintaxis
areaObject.alt=alternate_text
Soporte del navegador
![]()
![]()
![]()
![]()
![]()
Todos los navegadores principales soportan el atributo alt
Ejemplo
Ejemplo
El siguiente ejemplo devuelve el texto alternativo del área "Venus" en el mapa de imagen:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tutorial Ejemplo (example.com)</title>
</head>
<body>
<img src="planets.gif.html" width="145" height="126" usemap="#planetmap">
<map name="planetmap">
<area id="venus" shape="circle" coords="124,58,8" alt="Venus" href="venus.htm.html">
</map>
<p>Texto alternativo de Venus:
<script>
document.write(document.getElementById("venus").alt);
</script>
</p>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>Tutorial Ejemplo (example.com)</title>
</head>
<body>
<img src="planets.gif.html" width="145" height="126" usemap="#planetmap">
<map name="planetmap">
<area id="venus" shape="circle" coords="124,58,8" alt="Venus" href="venus.htm.html">
</map>
<p>Texto alternativo de Venus:
<script>
document.write(document.getElementById("venus").alt);
</script>
</p>
</body>
</html>
El resultado del ejemplo anterior es:
Texto alternativo de Venus: Venus
Pruébalo »
Objeto Area Otras extensiones