forked from 202252197/ChatGPT_JCM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
44 lines (37 loc) · 769 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>666</title>
<style type="text/css">
.div1{
width: 500px;
height: 300px;
overflow-y: scroll;
margin: auto;
border: 1px solid red;
}
.div2{
width: 200px;
height: 50px;
border: 1px solid red;
}
</style>
</head>
<body>
<div class="div1">
666
</div>
<button type="button" id="btn">添加</button>
<script type="text/javascript">
var div1 = document.querySelector('.div1');
var btn = document.querySelector('#btn');
btn.addEventListener('click',function(){
console.log('66')
var k = div1.innerHTML;
div1.innerHTML = k+"<br/>66";
div1.scrollTop = div1.scrollHeight;
})
</script>
</body>
</html>