Get an Abbreviation Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Abbreviation


The Abbreviation object represents an HTML <abbr> element.

You can access an <abbr> element by using getElementById():

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<p>The <abbr id="myAbbr" title="title of abbr">abbr test</abbr> test testtest.</p>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

function myFunction() {//from  w  w  w  .  ja  v a  2  s . c o m
    var x = document.getElementById("myAbbr").title;
    document.getElementById("demo").innerHTML = x;


Related Tutorials