<html>
<head>
<script type="text/javascript">
function alertInnerHTML()
{
alert(document.getElementById("td1").innerHTML);
}
</script>
</head>
<body>
<table border="1">
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td id="td1" style="max-width:8px;text-overflow:ellipsis;
overflow:hidden;">Peter11111111111111111111111111111111111111111111111111111111111111</td>
<td id="td1">Griffin</td>
</tr>
</table>
<br />
<input type="button" onclick=alertInnerHTML() value="Alert innerHTML" />
</body>
</html>
td中内容太长隐藏
最新推荐文章于 2021-09-02 16:23:50 发布