You are here: Reference > JavaScript > client-side > HTML DOM > properties > abbr (td, th)

abbr property (td, th)

Browser support:
Sets or retrieves an abbreviation for a table header or table cell data.
If this property is set, it prevents users from hearing the whole cell's contents, only the value of the abbr property will be audible. There isn't any functionality implemented for this property in commonly used browsers.

Syntax:

object.abbr;
You can find the related objects in the Supported by objects section below.
This property is read/write.
HTML page for this property: abbr

Possible values:

String that sets or retrieves the abbreviated text.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the abbr attribute:
<table border="1px">
    <tr>
        <td abbr="def">Use short abbreviated names because user agents may render them repeatedly.</td>
        <td>Cell Data</td>
    </tr>
    <tr>
        <td>Cell Data</td>
        <td>Cell Data</td>
    </tr>
</table>
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the abbr property:
<head>
    <script type="text/javascript">
        function GetAbbr () {
            var table = document.getElementById ("myTable");
            var abbrStr = table.rows[0].cells[0].abbr;
            alert (abbrStr);
        }
    </script>
</head>
<body>
    <table border="1px" id="myTable">
        <tr>
            <td abbr="def">Abbreviated names should be short since user agents may render them repeatedly.</td>
            <td>Cell Data</td>
        </tr>
        <tr>
            <td>Cell Data</td>
            <td>Cell Data</td>
        </tr>
    </table>
    <button onclick="GetAbbr ()">Get first cell abbreviation!</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

External links:

User Contributed Comments

Post Content

Post Content