Javascript examples for DOM HTML Element:Abbreviation
The Abbreviation object represents an HTML <abbr> element.
You can access an <abbr> element by using getElementById():
<!DOCTYPE html> <html> <body> <p>The <abbr id="myAbbr" title="title of abbr">abbr test</abbr> test testtest.</p> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> 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; } </script> </body> </html>