如何在悬停元素时向表格元素提供工具提示。
<th id="metricsHead">Grade_Desc</th>
将鼠标悬停在元素上时,工具提示应为“等级描述”
最佳答案
只需设置title
属性
<table>
<th id="metricsHead" title="Grade Description">Grade_Desc</th>
</table>
如果你想动态设置
$('#metricsHead').attr('title', "Grade Description")
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table>
<th id="metricsHead" >Grade_Desc</th>
</table>
关于javascript - 如何为 HTML 中表格的 <th> 元素提供工具提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39137799/