HTML | DOM Cite Object
The DOM Cite Object is used to represent HTML <Cite> element. The Cite element is accessed by getElementById().
Syntax
document.getElementById("id");
Where “id” is the ID assigned to the cite tag.
Example-1:
<!DOCTYPE html> <html> <head> <title>DOM cite Object</title> <style> body { text-align: center; } </style> </head> <body> /wp-content/uploads/geeksforgeeks-25.png" alt="gfg"> <!-- cite id--> <p><cite id="GFG">GeeksforGeeks Image</cite></p> <button onclick="Geeks()">Submit</button> <script> function Geeks() { var w = document.getElementById("GFG"); w.style.color = "coral"; w.style.fontWeight = "bold"; } </script> </body> </html> |
Output:
Before Clicking on Button:

After Clicking On Button:

Example-2: Cite Object can be created by using the document.createElement method.
<!DOCTYPE html> <html> <head> <title>DOM cite Object</title> <style> body { text-align: center; } </style> </head> <body> <h2>DOM Cite Object</h2> <button onclick="Geeks()"> Submit </button> /wp-content/uploads/geeksforgeeks-25.png" alt="gfg"> <script> function Geeks() { var cite = document.createElement("CITE"); var text = document.createTextNode("GeeksforGeeks Image"); cite.appendChild(text); document.body.appendChild(cite); } </script> </body> </html> |
Output
Before Clicking on Button:
Afte Clicking on Button:

Supported Browsers: The browser supported by DOM Cite Object are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari
Recommended Posts:
- HTML | cite Tag
- HTML | <ins> cite Attribute
- HTML | DOM ins cite Property
- HTML | <del> cite Attribute
- HTML | <q> cite Attribute
- HTML | DOM del cite Property
- HTML | cite attribute
- HTML | <blockquote> cite Attribute
- HTML | DOM blockquote cite Property
- HTML | DOM Object Object
- HTML | DOM Map Object
- HTML | DOM li Object
- HTML | DOM dl Object
- HTML | DOM Pre 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.



