严格判断。这是用于培训的测试代码。我无法弄清楚为什么ul
无法显示getElementsByTagName
标记的最后一个元素
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div>Users:</div>
<ul>
<li>Max</li>
<li>Daniel</li>
</ul>
dsfsdf
<script>
var head = document.head.firstChild; // work good
alert(head);
var ul = document.body.getElementsByTagName("ul").lastChild; // undefined
alert(ul);
</script>
</body>
</html>
<!-- <script src="test.js"></script> -->