4,008
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<title> new document </title>
<script language="javascript">
<!--
function func(){
div1.innerHTML += new Date() +'<br>';
document.getElementById('div1').scrollTop = document.getElementById('div1').scrollHeight; //注意这句
setTimeout('func()', 500);
}
//-->
</script>
</head>
<body onload="func()">
<div id="div1" style="width:500px; height:500px; overflow:scroll;"></div>
</body>
</html>