JavaScript Reference/Javascript Methods/getNamedItem

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

"getNamedItem()" Example

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



"getNamedItem()" is applied to

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



"getNamedItem()" Syntax, Parameters and Note

Note:
Returns the specified attribute value.
    
Syntax:
    
document.all.elementID.attributes.getNamedItem(param1)
Parameters:
    param1   Required; the name of the attribute.