HTML DOM Abbreviation Object


The <abbr> element is used in HTML to display abbreviations. The Abbreviation object represent this <abbr> element.

In the below example, we will learn how to access an abbreviation object −

Example

 Live Demo

<!DOCTYPE html>
<html>
<body>
<h2>Demo Heading</h2>
<abbr id="myid" title="Board of Control for Cricket in India">BCCI</abbr>
<button onclick="display()">Display the abbreviation title</button>
<p id="demo">Abbreviation Title

<script>    function display() {       var a = document.getElementById("myid").title;       document.getElementById("demo").innerHTML = a;    } </script> </body> </html>

Output

Click on the button to display the title −

Updated on: 30-Jul-2019

153 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements