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 −


 Live Demo

<!DOCTYPE html>
<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>


Click on the button to display the title −