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.
Example-1:
<!DOCTYPE html> <html> <head> <title>DOM blockquote object</title> <style> body { text-align: center; } h1 { color: green; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2> DOM <blockquote> Object</h2> <blockquote ID="GFG" cite="www.geeksforgeeks.org"> GeeksforGeeks: A computer science portal for geeks </blockquote> <button onclick="myGeeks()">Submit</button> <p id="sudo"></p> <script> function myGeeks() { var w = document.getElementById("GFG").cite; document.getElementById("sudo").innerHTML = w; } </script> </body> </html> |
Output:
Before Clicking on Button:

After Clicking on Button:

Example-2: Blockquote Object can be created by using the document.createElement method.
<!DOCTYPE html> <html> <head> <title>DOM blockquote object</title> <style> body { text-align: center; } h1 { color: green; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2> DOM <blockquote> Object</h2> <button onclick="myGeeks()">Submit</button> <p id="sudo"></p> <script> function myGeeks() { var g = document.createElement("BLOCKQUOTE"); var f = document.createTextNode("GeeksforGeeks:"+ "A computer science portal for geeks."); g.setAttribute("cite", "www.geeksforgeeks.org"); g.appendChild(f); document.body.appendChild(g); } </script> </body> </html> |
Output:
Before Clicking on Button:

After Clicking on Button:

Supported Browsers: The browser supported by DOM Blockquote Object are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari
Recommended Posts:
- HTML | blockquote Tag
- HTML | DOM blockquote cite Property
- HTML | <blockquote> cite Attribute
- HTML | DOM Object Object
- HTML | DOM Ul Object
- HTML | DOM BR Object
- HTML | DOM DFN Object
- HTML | DOM DD Object
- HTML | DOM Nav Object
- HTML | DOM S Object
- HTML | Object tag
- HTML| DOM Ins Object
- HTML | DOM DT Object
- HTML | DOM dl Object
- HTML | DOM Div 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.



