解决因`script`前置而造成的操作 DOM 报错
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<script>
document.addEventListener("DOMContentLoaded", function () {
console.log(document.body.innerHTML);
});
</script>
</head>
<body>
<div>Hello, World!</div>
</body>
</html>