HTML DOM getNamedItem() Method

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP







<!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]
-->




HTML DOM getNamedItem() Method


❮ Attribute Object




Example


Get the value of the onclick attribute of a button element:



var btn = document.getElementsByTagName("BUTTON")[0];
btn.attributes.getNamedItem("onclick").value;

<!--

The result of btn could be:



myFunction()
-->
Try it Yourself »


Definition and Usage


The getNamedItem() method returns the attribute node with the specified name from a NamedNodeMap object.



Browser Support


The numbers in the table specify the first browser version that fully supports the method.














Method
getNamedItem() Yes 9.0 Yes Yes Yes

Syntax



namednodemap.getNamedItem(nodename)


Parameter Values








ParameterType Description
nodenameStringRequired. The name of the node in the namedNodeMap you want to return

Technical Details






Return Value: A Node object, representing the attribute node with the specified name
DOM Version Core Level 1

❮ Attribute Object


Popular posts from this blog

PHP code is not being executed, instead code shows on the page

Administrative divisions of China

Cardinality of the set of algorithms