HTML DOM firstElementChild Property Last Updated : 28 Jul, 2025 Comments Improve Suggest changes 5 Likes Like Report 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 an element.Null: If there are no child elements. Syntax node.firstElementChild() Example: In this example, we will use HTML DOM firstElementChild Property. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM firstElementChild Property </title> </head> <body> <p>GeeksForGeeksTopics</p> <ul id="Sections"> <li>Array</li> <li>LinkedList</li> <li>Stack</li> <li>Queue</li> <li>Tree</li> <li>Graph</li> </ul> <p> Click the button to get the first child of the node having id is "Sections". </p> <!--button is used to run example function--> <button onclick="example()">Click</button> <p id="GeeksForGeeks sections first node"></p> <script> // JavaScript code to get the node whose // id is "Section" function example() { // x is used to store the element // whose id is "Sections". let x = document.getElementById("Sections") .firstElementChild.innerHTML; document.getElementById("GeeksForGeeks sections" + " first node").innerHTML = x; } </script> </body> </html> Output: Supported Browsers: The browser supported by DOM firstElementChild are listed below: Google Chrome 1 and aboveEdge 12 and aboveInternet Explorer 9 and aboveFirefox 3.5 and aboveOpera 10 and aboveSafari 4 and above Create Quiz Comment S Shahnawaz_Ali Follow 5 Improve S Shahnawaz_Ali Follow 5 Improve Article Tags : Web Technologies HTML Web technologies HTML-DOM HTML-Property +1 More Explore HTML BasicsHTML Introduction4 min readHTML Editors4 min readHTML Basics7 min readStructure & ElementsHTML Elements4 min readHTML Attributes7 min readHTML Headings3 min readHTML Paragraphs3 min readHTML Text Formatting4 min readHTML Block and Inline Elements3 min readHTML Charsets4 min readListsHTML Lists3 min readHTML Ordered Lists5 min readHTML Unordered Lists4 min readHTML Description Lists3 min readVisuals & MediaHTML Colors11 min readHTML Links Hyperlinks2 min readHTML Images7 min readHTML Favicon4 min readHTML Video4 min readLayouts & DesignsHTML Tables9 min readHTML Iframes4 min readHTML Layout4 min readHTML File Paths3 min readProjects & Advanced TopicsHTML Forms5 min readHTML5 Semantics5 min readHTML URL Encoding4 min readHTML Responsive Web Design11 min readTop 10 Projects For Beginners To Practice HTML and CSS Skills8 min readTutorial ReferencesHTML Tags - A to Z List15+ min readHTML Attributes Complete Reference8 min readHTML Global Attributes5 min readHTML5 Complete Reference8 min readHTML5 MathML Complete Reference3 min readHTML DOM Complete Reference15+ min readHTML DOM Audio/Video Complete Reference2 min readSVG Element Complete Reference5 min readSVG Attribute Complete Reference8 min readSVG Property Complete Reference7 min readHTML Canvas Complete Reference4 min read Like