标签:div 滚动条 底部
<!DOCTYPE html PUBLIC>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function add() {
var now = new Date();
var nowtime = now.getFullYear()+‘/‘+(now.getMonth()+1)+‘/‘+now.getDate()+‘ ‘+now.getHours()+‘:‘+now.getMinutes()+‘:‘+now.getSeconds();
var div = document.getElementById(‘scrolldIV‘);
div.innerHTML = div.innerHTML + ‘<div style="height:20px">当前时间: ‘ + nowtime + ‘<div/>‘;
div.scrollTop = div.scrollHeight;}
</script>
</head>
<body>
<div id="scrolldIV" style="overflow:scroll; height: 100px; width: 400px; border: 1px solid #999;"></div>
<input type="button" value="显示时间" onclick="add();">
</body>
</html>
本文出自 “喜欢放肆爱需克制” 博客,请务必保留此出处http://tiaopitu.blog.51cto.com/9191152/1543507
标签:div 滚动条 底部
原文地址:http://tiaopitu.blog.51cto.com/9191152/1543507