HTML DOM Área atributo href
Definición y Uso
conjuntos de propiedades href o devuelve el valor de un gramo del atributo href área.
atributo href especifica un enlace a un área objetivo.
gramática
areaObject.href=URL
Soporte para el navegador
Todos los principales navegadores soportan atributo href
Ejemplos
Ejemplos
En el siguiente ejemplo se devuelve el atributo href del área de mapa de imágenes "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="Venus" href="venus.htm">
</map>
<p>金星的href属性值:
<script>
document.write(document.getElementById("venus").href);
</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="Venus" href="venus.htm">
</map>
<p>金星的href属性值:
<script>
document.write(document.getElementById("venus").href);
</script>
</p>
</body>
</html>
Los ejemplos de la salida anterior:
Venus valor del atributo href: http://www.w3big.com/try/demo_source/venus.htm
Trate »
objetos de área