HTML DOM Área atributo alt
Definición y Uso
atributo alt alt se puede configurar para volver a un área de valor de la propiedad.
alt atributo para especificar el texto de reemplazo cuando el navegador no puede mostrar un área visualizada.
gramática
areaObject.alt=alternate_text
Soporte para el navegador
Todos los principales navegadores soportan el atributo alt
Ejemplos
Ejemplos
El siguiente ejemplo devuelve el texto de la imagen de sustitución mapa de la zona "Venus":
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<body>
<img src="planets.gif" width="145" height="126" usemap="#planetmap">
<map name="planetmap">
<area id="venus" shape="circle" coords="124,58,8" alt="金星" href="venus.htm">
</map>
<p>金星的替代文本:
<script>
document.write(document.getElementById("venus").alt);
</script>
</p>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<body>
<img src="planets.gif" width="145" height="126" usemap="#planetmap">
<map name="planetmap">
<area id="venus" shape="circle" coords="124,58,8" alt="金星" href="venus.htm">
</map>
<p>金星的替代文本:
<script>
document.write(document.getElementById("venus").alt);
</script>
</p>
</body>
</html>
Los ejemplos de la salida anterior:
金星的替代文本: 金星
Trate »
objetos de área