I have been trying to append "Avocado" to this list but then I get the error message
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>
What am I doing wrong here, please?