HTML | DOM Summary Object Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report The DOM Summary Object is used to represent the HTML <summary> element . The Summary element is accessed by getElementById(). Syntax: document.getElementById("ID"); Where “id” is the ID assigned to the “summary” tag. Example-1: html <!DOCTYPE html> <html> <head> <title>DOM Summary Object</title> <style> h2 { color: green; font-size: 35px; } summary { font-size: 40px; color: #090; font-weight: bold; } </style> </head> <body> <center> <h2>DOM Summary Object </h2> <details> <!-- assigning id to summary tag. --> <summary id="GFG">GeeksforGeeks</summary> <p>A computer science portal for geeks</p> <div>It is a computer science portal where you can learn programming.</div> </details> <br> <button onclick="myGeeks()">Submit</button> <p id="sudo"></p> <script> function myGeeks() { // Accessing summary tag var x = document.getElementById("GFG").innerHTML; // display text content present in summary tag document.getElementById("sudo").innerHTML = x; } </script> </center> </body> </html> Output: Before Clicking On Button: After Clicking On Button: Example-2: Summary Object can be created by using the document.createElement method. html <!DOCTYPE html> <html> <head> <title>DOM Summary Object</title> <style> h1 { color:green; font-size:35px; } h2 { color: green; font-size: 35px; } summary { font-size: 40px; color: #090; font-weight: bold; } </style> </head> <body> <center> <h1>GeeksForGeeks</h1> <h2>DOM Summary Object </h2> <br> <button onclick="myGeeks()">Submit</button> <script> function myGeeks() { // Creating details object. var g = document.createElement("DETAILS"); document.body.appendChild(g); // Creating summary object. var summary = document.createElement("SUMMARY"); var text1 = document.createTextNode("GeeksForGeeks"); summary.appendChild(text1); var para = document.createElement("P"); var text2 = document.createTextNode( "A computer science portal for geeks"); para.appendChild(text2); g.appendChild(summary); g.appendChild(para); } </script> </center> </body> </html> Output: Before Clicking On Button: After Clicking On Button: Supported Browser: The browser supported by DOM Summary Object are listed below: Google Chrome Internet Explorer Firefox Safari Opera Comment More infoAdvertise with us Next Article HTML | DOM Style textDecorationColor Property M manaschhabra2 Follow Improve Article Tags : Misc Web Technologies HTML HTML-DOM Practice Tags : Misc Similar Reads HTML DOM insertAdjacentHTML() Method The DOM insertAdjacentHTML() method is used to insert a text as HTML file to a specified position. This method is used to change or add text as HTML. Syntax : node.insertAdjacentHTML(specify-position, text-to-enter) Return Value : This will return the page with the specified change. There are four l 2 min read HTML DOM | Style pageBreakAfter Property The Style pageBreakAfter property is used for setting or returning the page-break behavior after an element in printing or print preview. The Style pageBreakAfter property does not affect the absolutely positioned elements. Syntax : To get the property: object.style.pageBreakAfter To set the propert 2 min read HTML | DOM Style columnGap Property The DOM Style columnGap property specifies the gap between the columns. Syntax : For return the value: object.style.columnGap For set the value: object.style.columnGap = "length|normal|initial|inherit" Property Values: length: Set the column gap in length unit. normal: The default value of column ga 4 min read HTML | DOM Style textDecorationColor Property The Style textDecorationColor property in HTML DOM is used to set the color of the text-decoration like underlines, overlines, and line-throughs. It can also return the text-decoration color. Syntax: It returns the textDecorationColor property.object.style.textDecorationColorIt is used to set the te 2 min read HTML DOM insertAdjacentElement() Method The insertAdjacentElement() method inserts the specified element at the specified position. The legal values for this position are. afterbeginafterendbeforebeginbeforeend Syntax: node.insertAdjacentElement(position, element) Parameters: This method requires 2 parameters. position: A position relativ 2 min read HTML | DOM Style padding Property The Style padding property is used for setting or returning the padding of an element. The Style padding property can be used in 4 different ways : div {padding: 30px} -In this case, all the four sides have a padding of 30px.div {padding: 100px 50px} -In this case, the top and bottom padding will be 4 min read HTML | DOM Style fontVariant Property The style fontVariant Property in DOM HTML is used to set the font in capital letters. This property mainly converts lowercase to uppercase letters but the letters have a small font size compared to remaining text. Syntax: It returns the fontVariant property.object.style.fontVariantIt used to set th 2 min read HTML | DOM Location replace() Method The DOM Location replace() Method in HTML is used to replace the current document with the specified one. This method is different from the assign() method as this removes the current document from the document history, therefore it is not possible to go back to the previous document using the 'back 1 min read HTML DOM Style columnRule Property The Style columnRule property in HTML DOM sets or returns the width, style, and color of the rule between the columns. To get the columnRule Propertyobject.style.columnRule = valueTO set the columnRule propertyobject.style.columnRule = "column-rule-width column-rule-style column-rule-color | initial 4 min read HTML | DOM Style textIndent Property The DOM Style textIndent Property is used for indentation of the first line in each block of text. It also takes negative values. If the value is negative then the first line will be indented to the left. Syntax: It is used to set the textIndent property:object.style.textIndent = "length|%|initial|i 2 min read Like