JavaScript Reference/Javascript Methods/getNamedItem

Материал из Web эксперт
Версия от 11:22, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

"getNamedItem()" Example

   <source lang="javascript">
   

<html> <body> <button onclick="alert(this.attributes.getNamedItem("onclick").value);"> Get named item</button> </body> </html>


     </source>
   
  


"getNamedItem()" is applied to

   <source lang="javascript">

Names noted with an asterisk (*) are JavaScript properties only. +----------------+--------------------------------------------------------------+ | Applied_To |attributes* | +----------------+--------------------------------------------------------------+

     </source>
   
  


"getNamedItem()" Syntax, Parameters and Note

   <source lang="javascript">

Note: Returns the specified attribute value.

Syntax:

document.all.elementID.attributes.getNamedItem(param1) Parameters:

   param1   Required; the name of the attribute.
   
     
     </source>