JavaScript DHTML/Javascript Collections/areas

Материал из Web эксперт
Перейти к: навигация, поиск

"areas" Example

   <source lang="html4strict">
   

<html> <head> <script language="JavaScript"> function function1() {

   var m = document.all.myMap.areas.length;
   alert("There are "+m+" areas within the map "myMap""); 

} </script> </head> <body onload="function1();">

<img src="http://www.wbex.ru/style/logo.png" alt="" width="200" height="100" usemap="#myMap"> <map name="myMap"> <area id="area1" shape="rect" coords="0, 0, 100, 50" href="http://www.wbex.ru" onClick="return false"> <area id="area2" shape="rect" coords = "100, 0, 200, 50" href="http://www.wbex.ru" onClick="return false"> <area id="area3" shape="rect" coords = "0, 50, 100, 100" href="http://www.wbex.ru" onClick="return false"> <area id="area4" shape="rect" coords = "0, 0, 0, 0" href="http://www.wbex.ru" onClick="return false"> </map>

</body> </html>


     </source>