JavaScript Reference/Javascript Collections/links

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

"links" Example

   <source lang="javascript">
   

<html> <body> <a href="http://www.wbex.ru">www.wbex.ru website</a> <a href="http://www.wbex.ru">www.wbex.ru website</a> <a href="http://www.wbex.ru">www.wbex.ru website</a> <a href="http://www.wbex.ru">www.wbex.ru website</a> <a href="http://www.wbex.ru">www.wbex.ru website</a> <button onclick="alert(document.links.length);"> No. of links on page </button> </body> </html>


     </source>
   
  


"links" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |document | +----------------+--------------------------------------------------------------+

     </source>
   
  


"links" JavaScript properties and JavaScript methods

   <source lang="javascript">

JavaScript properties and JavaScript methods

item(), length, namedItem(), tags(), urns()


     </source>
   
  


"links" Syntax Parameters and Note

   <source lang="javascript">

Note: Returns an array of all links in both the <a> and <area> elements in a document.

Syntax:

document.links // returns all links document.links(param1) // returns an individual link Parameters:

   param1   Required; the zero-based index
   
     
     </source>