-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntroduction.html
More file actions
37 lines (35 loc) · 1.1 KB
/
Introduction.html
File metadata and controls
37 lines (35 loc) · 1.1 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>introduce</title>
</head>
<style>
.example1,.example2{
margin: 50px;
font-size: 1.5rem;
line-height: 3rem;
background-color: #eeeeee;
}
</style>
<body>
<div class="example1">
<h2>JavaScript in Body</h2>
<p id="demo">A Paragraph.</p>
<button type="button" onclick="myFunction()">Try it</button>
</div>
<div class="example2">
1.组成:ECMAScript + Web APIS(DOM+BOM);JS语言基础+页面文档对象类型+浏览器对象类型 <br>
2.书写位置:<br>
内部,写在body最底部;<br>
外部,body最底部用script引入;<script urc='my.js'></script> <br>
内联,与CSS行内相似,<button onlick="alert ('aaa')">click me!</button> <br>
</div>
<script>
function myFunction(){
document.getElementById("demo").innerHTML="Paragraph changed" /*.innerHTML用来改变找到的元素内部的HTML内容*/
}
</script>
</body>
</html>