<input type="button" onclick="jiedian()" value="html子节点"><!--按钮 -->
<input type="button" onclick="tobu()" value="head子节点"><!--按钮 -->
<input type="button" onclick="weibu()" value="body子节点"><!--按钮 -->
<input type="button" onclick="yuasu()" value="所有元素"><!--按钮 -->
<input type="button" onclick="diyi()" value="获取第一个li"><!--按钮 -->
<input type="button" onclick="zuiho()" value="获取第一个li"><!--按钮 -->
<script>
function jiedian() {
console.log(documentElement); //html子节点
}
function tobu() {
console.log(document.head);//head子节点
}
function weibu() {
console.log(document.body);//body子节点
}
function yuasu() {
console.log(document.all);//所有元素
}
function diyi() {
console.log(document.firstElementChild.firstElementChild);//获取第一个li
}
function zuiho() {
console.log(document.lastElementChild.lastElementChild);//获取第一个li
}