js代码控制div滚动轴默认在最下方...
时间:2010-08-15 来源:wyj518
js代码控制div滚动轴默认在最下方
function begin() {
document.getElementById('HistoryContent').scrollTop = document.getElementById('HistoryContent').scrollHeight;
}
<tr>
<td height="100" align="left" valign="top" bgcolor="#FFFFFF">
<div id="HistoryContent">
11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br> </div>
</td>
</tr>
<tr>
<td valign="top" bgcolor="#FFFFFF"><form id="form1" name="form1" method="post" action="">
<input type="text" name="talk" id="talk" size="30" />
<input type="button" name="button" id="button" value="提交" onclick="begin();" />
</form></td>
</tr>