<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<div>页面1</div>
<div>页面2</div>
<div>页面3</div>
</body>
<script>
let mydiv = document.getElementsByTagName("div");
mydiv.forEach(function(data){
console.log(data);
});
</script>
</html>
为什么无法遍历输出?