HTML DOM abbr 属性
定义和用法
abbr 属性可设置或返回表元中内容的缩写版本(针对非可视的媒介,比如语音和盲文)。
语法
- tabledataObject.abbr=text
实例
下面的例子可提示某个单元格的 abbr:
- <html>
- <head>
- <script type="text/javascript">
- function alertAbbr()
- {
- alert(
document.getElementById('td1').abbr
);- }
- </script>
- </head>
- <body>
- <table border="1">
- <tr>
- <th>Firstname</th>
- <th>Lastname</th>
- </tr>
- <tr>
- <td id="td1" abbr="Some text">Peter</td>
- <td id="td2">Griffin</td>
- </tr>
- </table>
- <br />
- <input type="button" onclick="alertAbbr()"
- value="Alert abbr" />
- </body>
- </html>