主讲人 Eol
功能简单、样式固定
Type 1: With Content

Content 中可以写入另一个 Element
Type 2: Without Content
<img src="https://www.tongji.edu.cn/images/18/05/03/1d0wfqyjja/footlogo.png" />
| < | > | & | |
|---|---|---|---|
|   | < | > | & |
全部的 HTML Entity 可见 https://en.wikipedia.org/wiki/List_of_XML_and_HT...
<!-- This is a comment. --><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>My test page</title>
</head>
<body>
<p>This is my page</p>
</body>
</html>什么是编程?
let a = 10 - 7
let b
if (a > 5) {
b = 'a > 5'
} else {
b = 'a <= 5'
}
console.log(b)for (let i = 0; i < 5; i = i + 1) {
console.log(i)
}
let i = 0
while (i < 5) {
console.log(i)
i = i + 1
}let i = 0
while (i < 5) {
if (i == 3) {
console.log('Now i is 3')
} else {
console.log(i)
}
++i
}// 函数声明
function some_function_name () {
console.log('Executed!')
}
// 函数调用
some_function_name()
some_function_name() // 可以重复利用
some_function_name()function sum_from_1 (n) {
let sum = 0
let i = 1
while (i <= n) {
sum += i
++i
}
return sum
}
let result = sum_from_1(3)
console.log(result)
console.log(sum_from_1(50))function foo (n) {
console.log(`foo is executed, and n is ${n}`)
}
let bar = foo
foo(1)
bar(2)将循环输出一个数组内全部元素的代码封装成函数(函数名任意)。调用函数验证是否正确。