HTML DOM nextElementSibling Property Last Updated : 09 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The nextElementSibling property is used to return the immediate next element of the specified element, in the same tree level or null if the specified element is the last one in the list. It is a read-only property. It differs from the nextSibling property as nextSibling returns the next sibling node as an element node, a text node, or a comment node while nextElementSibling returns the next sibling as an element node (i.e. it ignores text and comment nodes). Syntax: node.nextElementSibling Return value: This property returns a next sibling of the specified element or null if the current element has no next sibling. Example: In this example, we will use the nextElementSibling property HTML <!DOCTYPE html> <html> <head> <title> DOM nextSibling Property </title> </head> <body style="text-align: center"> <h2 style="color:green;"> DOM nextElementSibling Property </h2> <h4 id="h42">Web Languages:</h4> <select size="4"> <option>HTML</option> <option id="Select">CSS</option> <option>JAVA SCRIPT </option> <option>XML</option> </select> <br> <br> <button onclick="geek()">Next of CSS</button> <br> <br> <p id="p" style="margin:auto; width: 40%"></p> <script> function geek() { let a = document.getElementById("Select").nextElementSibling; document.getElementById("p").innerHTML = a.text; document.getElementById("p").style.color = "white"; document.getElementById("p").style.background = "green"; } </script> </body> </html> Output: Supported Browsers: The browser supported by nextElementSibling property are listed below: Google Chrome 2.0Internet Explorer 9.0Firefox 3.5Opera 10.0Apple Safari 4.0 Comment More infoAdvertise with us V Vishal Chaudhary 2 Follow Improve Article Tags : Web Technologies HTML Web technologies HTML-DOM Similar Reads HTML DOM offsetWidth Property The DOM offsetWidth property is used to return the layout width of an element as an integer. It is measured in pixels. It includes width, border, padding, and vertical scrollbars but not margin. If the element is hidden then it returns 0. Syntax: element.offsetWidth Return Value: It returns the layo 2 min read HTML DOM Style borderRadius Property The DOM Style borderRadius Property is used to set or return the four different borderRadius properties such as borderTopRightRadius, borderBottomRightRadius, and borderBottomLeftRadius of an element. It is used to add a rounded corner in an element. Syntax: It is used to get the border radius prope 2 min read HTML DOM getAttribute() Method The HTML DOM getAttribute() method is used to retrieve the value of a specified attribute from an HTML element. It returns the attribute's value as a string or null if the attribute doesn't exist.Note: It will return a null or an empty string if the specified attribute doesn't exist.SyntaxObject.get 2 min read HTML DOM parentElement Property The DOM parentElement property is used to return the parent element of a particular child element. It is a read-only property. The parentElement and parentNode properties are similar and the only difference is the parentElement property returns null if the parent node is not an element. Syntax: node 2 min read HTML DOM previousSibling Property The previousSibling property is used to return the previous node of the specified node as Node object or null if the specified node is the first in the list. It is a read-only property. Syntax: node.previousSibling Return value: This property returns a previous sibling of the specified node or null 1 min read HTML DOM innerText Property The DOM innerText Property is used to set or return the text content of a specified node and its descendants. This property is very similar to the text content property but returns the content of all elements, except for <script> and <style> elements. Syntax: It is used to set the innerT 2 min read HTML DOM nextSibling Property The nextSibling property returns the next node at the same tree level, providing a node object. It's read-only and navigates through sibling nodes within the document structure. Syntax: node.nextSiblingReturn value: Name Description Node The nextSibling property returns the next sibling node or null 2 min read HTML DOM isContentEditable Property The DOM isContentEditable property is used to return a boolean where true means the content of an element is editable and false represents content is not editable. This property is read-only. Syntax: Object.isContentEditable Return Value: This property returns a boolean value. true means that the co 1 min read HTML DOM implementation Property The DOM implementation property in HTML is used to return the DOMImplementation object associated with the current document. The DOMImplementation is the interface that represents a method providing the object which is not dependent on any particular document. Syntax: document.implementation Return 2 min read HTML DOM specified Property The DOM specified property is used to return the boolean value. It returns true if the element has a specified attribute, otherwise, it returns a false value if the element does not have a specific attribute. Syntax:attribute.specifiedReturn value: It returns the boolean value which represents wheth 2 min read Like