HTML DOM isSameNode() Method Last Updated : 09 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The isSameNode() method checks whether the two nodes are the same or not. This method is different from isequalNode(), where two different nodes can be equal but not the same, here the same node means that they are referencing the same object. Syntax: node.isSameNode(othernode) Parameters: The "othernode" parameter is required in this function. Return Value: Returns a Boolean value, if matches then True else False. Example: In this example, we will use isSameNode() method HTML <!DOCTYPE html> <html> <head> <title> HTML | DOM isSameNode() Method </title> <!--script to check if nodes are same--> <script> function isequal() { let out = document.getElementById("result"); let divele = document.getElementsByTagName("div"); out.innerHTML += "element 1 equals element 1: " + divele[0].isSameNode(divele[0]) + "<br/>"; out.innerHTML += "element 1 equals element 2: " + divele[0].isSameNode(divele[1]) + "<br/>"; out.innerHTML += "element 1 equals element 3: " + divele[0].isSameNode(divele[2]) + "<br/>"; } </script> </head> <body> <h3>Comparing the div elements.</h3> <!-- 3 div elements--> <div>GeeksforGeeks</div> <div>GfG</div> <div>GeeksforGeeks</div> <button onclick="isequal()">Check</button> <!-- Result--> <p id="result"></p> </body> </html> Output: Supported Browsers: The browser supported by DOM isSameNode() Method are listed below: Google Chrome 1Edge 12Internet Explorer 9Opera 12.1Safari 3Firefox 48 Comment More infoAdvertise with us P ProgrammerAnvesh Follow Improve Article Tags : Web Technologies HTML Web technologies HTML-DOM Similar Reads HTML DOM KeyboardEvent code Property The keyboardEvent code property in HTML represents a physical key on the keyboard. It is used to return the key that triggers the event. Syntax: event.code Return Value: It returns a string that represents which key is pressed. Example 1: With KeyDown Event HTML <html> <head> <title 2 min read HTML DOM lastChild Property The DOM lastChild property is used to return the last child of the specified node. It returns the last child nodes as text, comment, or element nodes (depend on which occurs at last). It is a read-only property. Syntax: node.lastChild Return Value: It returns a node object which represents the last 2 min read 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 Like