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:
<!DOCTYPE html> <html> <head> <title>aside tag</title> <style> .gfg { font-size: 30px; } aside { font-size: 40px; color: #090; font-weight: bold; } p { font-size: 20px; margin: 20px 0; } </style> </head> <body> //Assign ID to the aside tag. <aside id="GFG"> <h1>GeeksforGeeks</h1> <p>A computer science portal for geeks</p> </aside> <h2 style="font-size:35px;">DOM Aside object</h2> <button onclick="myGeeks()">Submit</buttom> <script> function myGeeks() { var w = document.getElementById("GFG"); w.style.color = "red"; } </script> </body> </html> |
Output:
Before Clicking on Button:

After Clicking on Button:

Example-2: Aside Object can be created by using the document.createElement Method.
<!DOCTYPE html> <html> <head> <title>aside tag</title> <style> .gfg { font-size: 30px; } p { font-size: 20px; margin: 20px 0; } </style> </head> <body> <center> <h2 style = "font-size:35px;">DOM Aside object</h2> <button onclick="myGeeks()">Submit</buttom> <script> function myGeeks() { var w = document.createElement("ASIDE"); w.setAttribute("id", "GFG"); document.body.appendChild(w); var heading = document.createElement("H3"); var text1 = document.createTextNode("GeeksForGeeks"); heading.appendChild(text1); document.getElementById("GFG" ).appendChild(heading); var para = document.createElement("P"); var text2 = document.createTextNode( "A Computer Science Portal for Geeks."); para.appendChild(text2); document.getElementById("GFG" ).appendChild(para); } </script> </body> </html> |
Output:
Before Clicking on Button:

After Clicking on Button:

Supported Browsers: The browser supported by DOM Aside Object are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari
Recommended Posts:
- HTML | DOM Object Object
- HTML| DOM HR Object
- HTML | DOM Nav Object
- HTML | DOM Ol Object
- HTML | DOM Kbd Object
- HTML | DOM Ul Object
- HTML | DOM li Object
- HTML | DOM dl Object
- HTML | Object tag
- HTML | DOM DT Object
- HTML | DOM Pre Object
- HTML | DOM BR Object
- HTML| DOM Ins Object
- HTML | DOM DD Object
- HTML | DOM DFN Object
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

