<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<p></p>
</body>
</html>
<script>
let mP=document.getElementsByTagName("p")[0]
mP.innerHTML="helloword"
</script>
//如果要写js文件新建一个.js文件然后把script中的代码复制过去,在html中用src引进去就可以
2.
<script>
let a=10;
let b=100;
if(a>b){
alert(a +" "+typeof a)
}else if(a<b){
alert(b +" "+typeof b)
}else{
alert("a=b")
}
</script>