Correcting teacher:天蓬老师
Correction status:qualified
Teacher's comments:今晚我们会继续深入了解js, 别错过
<!DOCTYPE html>
<html lang="zh_hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
document.write('<h1>Hello</h1>');
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="zh_hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script src="test.js" defer></script>
<h1>你好小明</h1>
<p id="p"></p>
</body>
</html>
document.getElementById('p').innerHTML = 'Hello';
<!DOCTYPE html>
<html lang="zh_hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script src="test.js" async></script>
<h1>你好小明</h1>
</body>
</html>
window.alert('hello');
<!DOCTYPE html>
<html lang="zh_hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
function a() {
console.log('a');
}
function A() {
console.log('A');
}
a();
A();
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="zh_hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
var name = '小明';
var name = '小红';
console.log(name);
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="zh_hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
var name = '小明';
function sayName() {
console.log('我的名字叫' + name);
}
sayName();
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="zh_hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
{let name = '小红';}
console.log(name);
var age =18;
console.log(age);
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="zh_hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
var name = '小明';
function sayName() {
console.log('我的名字叫' + name);
}
sayName();
</script>
</body>
</html>