The Wayback Machine - https://web.archive.org/web/20240829145637/https://www.geeksforgeeks.org/html-dom-abbreviation-object/
Open In App

HTML | DOM Abbreviation Object

Last Updated : 31 Jul, 2022
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

The DOM Abbreviation Object is used to represent the HTML <abbr> element. The abbreviation element is accessed by getElementById().

Example 1: 

html




<!DOCTYPE html>
<html>
    <head>
        <title>
            HTML DOM Abbreviation Object
        </title>
         
        <script>
            function myGeeks() {
                var abbr = document.getElementById("sudo").title;
                document.getElementById("geeks").innerHTML = abbr;
            }
        </script>
    </head>
     
    <body>
        <h2>DOM Abbreviation Object</h2>
         
        <abbr id = "sudo" title="GeeksforGeeks">
            GFG
        </abbr><br><br>
         
        <button onclick = "myGeeks()">
            Submit
        </button>
         
        <p id = "geeks"></p>
    </body>
</html>                   


Output: 

Before click on the button:

  

After click on the button:

  

Example 2: Abbreviation Object can be created by using the document.createElement Method. 

html




<!DOCTYPE html>
<html>
    <head>
        <title>
            HTML DOM Abbreviation Object
        </title>
         
        <!-- script for creating Abbreviation Object -->
        <script>
            function myGeeks() {
                var w = document.createElement("ABBR");
                var f = document.createTextNode("GFG");
                w.setAttribute("title", "GeeksforGeeks");
                w.appendChild(f);
                document.getElementById("sudo").appendChild(w);
            }
        </script>
    </head>
     
    <body>
        <h2>DOM Abbreviation Object</h2>
         
        <button onclick = "myGeeks()">
            Submit
        </button>
 
        <p id = "sudo"></p>
         
    </body>
</html>                   


Output: 

Before Click on the button:

  

After click on the button:

  

Supported Browsers: The browser supported by DOM Abbreviation Object are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari


Previous Article
Next Article

Similar Reads

Which tag is used to define the abbreviation of an element in HTML ?
In this article, we will discuss the tag that is used to define an abbreviation. The &lt;abbr&gt; tag in HTML is used to define the abbreviation or the short form of an element. The &lt;abbr&gt; and &lt;acronym&gt; tags are used as shortened versions and used to represent a series of letters. The abbreviation is used to provide useful information t
1 min read
How to Create Abbreviation of an Element using HTML?
The abbreviation of an element can be created by using the &lt;abbr&gt; tag. This tag is used to define the abbreviation or short form of an element. The &lt;abbr&gt; and &lt;acronym&gt; tags are used as shortened versions and used to represent a series of letters. The abbreviation is used to provide useful information to browsers, translation syst
1 min read
HTML | DOM Object Object
The Object object represents only HTML &lt;object&gt; element. We can access any &lt;object&gt; element by using the getElementById(); and also can create object element by using createElement(); method.Syntax: It is used to access Object element document.getElementById("id"); It is used to create object element document.createElement("object"); Pr
2 min read
HTML | DOM HTML Object
The HTML Object property in HTML DOM is used to represent or access the HTML &lt;html&gt; element with in the object. The &lt;html&gt; element is used to return the HTML document as an Element Object. Syntax: It is used to access a &lt;html&gt; element.var x = document.getElementsByTagName("HTML")[0]; It can also be used to access a &lt;html&gt; el
3 min read
How to check a JavaScript Object is a DOM Object ?
Prerequisite: DOM (Document object model), Instanceof Operator DOM (Document Object Model): Document Object Model is a hierarchical representation of HTML and XML documents in a format that is easier to interpret in terms of programming. It makes manipulation of tags, elements, attributes, and classes by interpreting its structure in the form of a
2 min read
HTML DOM Object useMap Property
The HTML DOM Object useMap Property is used to set or return the value of the usemap attribute of an &lt;object&gt; element. The &lt;object&gt; usemap attribute is used to specify the name of an image-map to use with the object. The image with clickable areas is called an image map. The useMap attribute is related to the association with the &lt;ma
2 min read
HTML | DOM Input Week Object
The Input Week object in HTML DOM represents an &lt;input&gt; element with type = "week" attribute. The element can be accessed by using getElementById() method. Syntax: document.getElementById("id"); where id is assigned to the &lt;input&gt; tag. Property Values: list: It returns the reference of data list that contains the week field.form: It ret
3 min read
HTML | DOM Column Object
The Column Object in HTML DOM is used to represent the HTML &lt;col&gt; element. This tag is used to set or get the properties of &lt;col&gt; element. It can be accessed by using getElementById() method.Syntax: document.getElementById("Col_ID"); This Col_ID is assigned to HTML &lt; col &gt; element.Property Values: span: Used to set or return span
2 min read
HTML DOM Del Object
The Del Object in HTML DOM is used to represent the HTML &lt;del&gt; element. The &lt;del&gt; element can be accessed by getElementById(). Object Properties: cite: It is used to set or return the value of the cite attribute of a deleted element.dateTime: It is used to sets or return the value of the dateTime attribute of a deleted element. Syntax:
2 min read
HTML | DOM Embed Object
The Embed Object in HTML DOM is used to represent the &lt;embed&gt; element. The &lt;embed&gt; element can be accessed by using getElementById() method. Note: This object is new in HTML 5. Property Values: height: It sets or returns the value of the height attribute. src: It sets or returns the value of the src attribute of an Embed Object, type: I
2 min read
HTML DOM Header Object
The DOM header object is used to represent the HTML &lt;header&gt; element. The header element can be accessed by the getElementById() method. Syntax: document.getElementById("id"); Where ‘id’ is the ID assigned to the header tag. Example 1: In the below program the header element is accessed and the color of the text inside the header element is c
1 min read
HTML DOM Footer Object
The DOM footer object is used to represent the HTML &lt;footer&gt; element. The footer element can be accessed using the getElementById() method. Syntax: document.getElementById("id"); Where ‘id’ is the ID assigned to the footer tag. Example 1: In the below program the footer element is accessed and the color of the text inside the footer element i
1 min read
HTML DOM Span Object
The DOM span object is used to represent the HTML &lt;span&gt; element. The span element can be accessed by using the getElementById() method. Syntax: document.getElementById("id"); Where 'id' is the ID assigned to the span tag. Example 1: In the below program the content inside the span element is accessed and appended to the paragraph element. C/
1 min read
HTML DOM HR Object
The DOM HR Object is used to represent the HTML &lt;hr&gt; element. The hr element is accessed by getElementById(). Properties: Align: It is used to set or return the alignment of a horizontal element.color: It is used to set or return the color of the horizontal element.noshade: It is used to set or return the noshade property in a horizontal elem
2 min read
HTML DOM Blockquote Object
The DOM Blockquote Object is used to represent the HTML &lt;Blockquote&gt; element. The Blockquote element is accessed by getElementById(). Syntax document.getElementById("id"); Where "id" is the ID assigned to the blockquote tag. Property Value cite: It is used to Sets or return the value of the cite attribute of a quotation Example 1: In this art
2 min read
HTML DOM BR Object
The DOM BR Object is used to represent the HTML &lt;br&gt; element. The br element is accessed by getElementById(). Syntax: document.getElementById(id) Where "id" is the ID assigned to the br tag. Property: clear: It is used to Sets or return the flow of text around floating objects Example 1: In this example, we will use DOM BR Object C/C++ Code
2 min read
HTML | DOM Meta Object
The DOM Meta Object is used to represent the HTML &lt;meta&gt; element. The Meta element is accessed by getElementById().Properties: Name attribute: This attribute is used to define the name of property.http-equiv attribute: This attribute is used to get http response message header.Scheme attribute: This attribute is used to specify a scheme to in
2 min read
HTML | DOM Object name Property
The HTML | DOM Object name Property is used to set or return the value of a name attribute of an &lt;object&gt; element. The name attribute is used to specify the name of the embedded file. Syntax: It returns the name property objObject.nameIt is used to set the name property. objObject.name = name Property Values: It contains the value i.e name wh
2 min read
HTML DOM Body Object
The DOM Body Object is used to represent the HTML &lt;Body&gt; element. The Body element is accessed by getElementByTagName(). It can also be accessed by using a document.body object. Object Properties: Alink: It is used to sets or return the color of the active link in a Document.background: It is used to sets or return the background image for a
2 min read
HTML DOM Aside Object
The DOM Aside Object is used to represent the HTML &lt;Aside&gt; 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: In this article, we will learn DOM Aside Object. C/C++ Code &lt;!DOCTYPE html&gt; &lt;html
2 min read
HTML DOM Bold Object
The DOM Bold Object is used to represent the HTML &lt;b&gt; element. The bold element is accessed by getElementById(). Syntax: document.getElementById("ID"); Where "id" is the ID assigned to the "b" tag. Example 1: In this example, we will use HTML DOM Bold Object C/C++ Code &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt; HTML DOM Bol
1 min read
HTML DOM Bdo Object
The DOM Bdo Object is used to represent the HTML &lt;Bdo&gt; element. The Bidirectional element is accessed by getElementById(). Properties: It has a dir attribute which is used to set or return the text direction of an element. Syntax: document.getElementById("GFG"); Where "GFG" is the ID assigned to the "bdo" tag. Example 1: In this example, we w
2 min read
HTML DOM Caption Object
The DOM Caption Object is used to represent the HTML &lt;Caption&gt; element (A caption element is used to specify the caption of a table). The Caption element is accessed by getElementById(). Properties: It has a align Attribute which is used to set or return the alignment of the caption. Syntax: document.getElementById("id"); Where "id" is the ID
2 min read
HTML DOM Cite Object
The DOM Cite Object is used to represent HTML &lt;Cite&gt; element. The Cite element is accessed by getElementById(). Syntax: document.getElementById("id"); Where "id" is the ID assigned to the cite tag. Example 1: In this example, we will use DOM Cite Object C/C++ Code &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;DOM cite Object
1 min read
HTML DOM Canvas Object
The DOM Canvas Object is used to represent the HTML &lt;Canvas&gt; element. The &lt;canvas&gt; tag is used to draw graphics in the document using javascript. It is new in HTML5. The canvas element is accessed by getElementById(). Syntax: accessed by getElementById("id"). Where “id” is the ID assigned to the Canvas tag. Example 1: In this example, w
2 min read
HTML DOM Code Object
The DOM Code Object is used to represent the HTML &lt;code&gt; element. The Code element is accessed by getElementById(). Syntax: document.getElementById("id"); Where 'id' is the ID assigned to the code tag. Example 1: In this example, we will use DOM Code Object C/C++ Code &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;body&gt; &lt;h1 style=&quot;color:gr
1 min read
HTML DOM Datalist Object
The DOM Datalist Object is used to represent the HTML &lt;Datalist&gt; element. The Datalist element is accessed by getElementById(). Properties: It has an 'Option' attribute which is used to return the collection of all options values in a datalist. Syntax: document.getElementById("gfg"); Where "gfg" is the ID assigned to the "Datalist" Tag. Colle
2 min read
HTML DOM DD Object
The DOM DD Object is used to represent the HTML &lt;DD&gt; element. The DD element is accessed by getElementById(). Syntax: document.getElementById("ID"); Where “id” is the ID assigned to the “dd” tag. Example 1: In this example, we will use DOM DD Object. C/C++ Code &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;HTML dd Tag&lt;/title
2 min read
HTML DOM DFN Object
The DOM DFN Object is used to represent the HTML &lt;dfn&gt; tag. The DFN element is accessed by getElementById(). Syntax: document.getElementById("ID"); Where “id” is the ID assigned to the “dfn” tag. Example 1: In this example, we will use DOM DFN Object. C/C++ Code &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;DOM DFN Object&lt;/t
1 min read
HTML| DOM Variable Object
The DOM Variable Object is used to represent HTML &lt;var&gt; element. The var element is accessed by getElementById(). Syntax: var element = document.getElementById("ID"); Where “id” is the ID assigned to the “var” tag. Example-1: C/C++ Code &amp;lt;!DOCTYPE html&amp;gt; &amp;lt;html&amp;gt; &amp;lt;head&amp;gt; &amp;lt;title&amp;gt;HTML| DOM Vari
2 min read
Article Tags :