HTML DOM getAttributeNode() Method Last Updated : 30 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The getAttributeNode() method in HTML DOM is used to return the attribute node with the specified name of an element, as an attribute object. This function is similar to the getAttribute() method but the only difference is that the getAttribute() method returns the value of an attribute node, not any attribute object. Syntax: element.getAttributeNode( attribute_name ) Parameters: This method accepts a single parameter attribute_name which is mandatory. This parameter is used to hold the name of the attribute. Return Value: This method returns an attribute object which represents the attribute node. Example: This example contains two heading elements and the task is to display the value of the attribute node of the second heading element. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM getAttributeNode() Method </title> </head> <body> <h1 class="Frst_heading"> GeeksforGeeks </h1> <h2 class="Second_heading"> DOM getAttributeNode() Method </h2> <p> Click on the button to display the value of attribute node </p> <button onclick="Geeks()"> Click Here! </button> <p id="result"></p> <!--script to display the value of class attribute --> <script> function Geeks() { let element_name = document.getElementsByTagName("H2")[0]; let attribute = element_name.getAttributeNode("class").value; document.getElementById("result").innerHTML = attribute; } </script> </body> </html> Output: Supported Browsers: The browser supported by DOM getAttributeNode() method are listed below: Google ChromeInternet ExplorerFirefoxOperaSafari Comment More infoAdvertise with us P ProgrammerAnvesh Follow Improve Article Tags : Web Technologies HTML HTML-DOM Similar Reads HTML DOM Aside Object The DOM Aside Object is used to represent the HTML <Aside> element. The Aside element is accessed by getElementById(). The aside Element is new in HTML 5. Syntax: document.getElementById("ID"); where "id" is the ID assigned to the aside tag. Example 1: In this article, we will learn DOM Aside 2 min read HTML DOM Bold Object The DOM Bold Object is used to represent the HTML <b> element. The bold element is accessed by getElementById(). Syntax: document.getElementById("ID"); Where "id" is the ID assigned to the "b" tag. Example 1: In this example, we will use HTML DOM Bold Object HTML <!DOCTYPE html> <html 1 min read HTML DOM blur() Method The DOM blur method is used to remove the keyboard focus from the current element and also give focus with the help of the focus() method. We can apply the blur to any element and enable it by doing some operations. For example, we can blur to text-box by clicking a button. Syntax: Object.blur() Exa 1 min read HTML DOM Body Object The DOM Body Object is used to represent the HTML <Body> element. The Body element is accessed by getElementByTagName(). It can also be accessed by using a document.body object. Object Properties: Alink: It is used to sets or return the color of the active link in a Document.background: It is 2 min read HTML DOM Blockquote Object The DOM Blockquote Object is used to represent the HTML <Blockquote> element. The Blockquote element is accessed by getElementById(). Syntax document.getElementById("id"); Where "id" is the ID assigned to the blockquote tag. Property Value cite: It is used to Sets or return the value of the ci 2 min read HTML DOM Bdo Object The DOM Bdo Object is used to represent the HTML <Bdo> element. The Bidirectional element is accessed by getElementById(). Properties: It has a dir attribute which is used to set or return the text direction of an element. Syntax: document.getElementById("GFG"); Where "GFG" is the ID assigned 2 min read HTML DOM firstElementChild Property The HTML DOM firstElementChild Property will return the first child of any node PreRequisites DOM (Document Object Model) Parameters: No parameters are required. Return value: The values returned by firstElementChild property are the following: A Node object: Representing the first child element of 1 min read HTML DOM isEqualNode() Method The HTML DOM isEqualNode() method checks whether the two nodes are equal or not. These nodes are considered equal if they are of the same type, having the same characteristics and the same attributes. The attributes do not have to be in the same order. Syntax: node.isEqualNode(othernode) Parameters: 2 min read HTML DOM clientWidth Property The DOM clientWidth Property is used to return the viewable width of a specific element including padding but excluding the measurement of margin, border, and scrollbar width. This property only returns the actual width of an element that is viewable or visible to the user. It is a read-only propert 1 min read HTML DOM click() Method The click() method is used to simulate the mouse click on an element. This method works exactly the same as the element is manually clicked. Syntax: HTMLElementObject.click() Parameters: No parameters required. Return Value: No return value. Example: In this example, when the cursor goes over the ra 1 min read Like