我一直在try 将"鳄梨"添加到此列表中,但随后我收到了错误消息
Uncaught TypeError: Cannot read properties of null (reading 'appendChild')
<!DOCTYPE html >
<html lang="de">
<head >
<title >Am I Loaded ?! </title >
<script>
const element = document.getElementById("list")
const elementText = document.createTextNode("Avocado")
element.appendChild(elementText);
</script>
</head>
<body>
<h1>Meine Obstschale</h1>
<ul id="list">
<li >Apple </li >
<li >Pear </li >
<li >Orange </li >
<li >Banana </li >
</ul >
</body >
</html>
请问我做错了什么?