I am trying to build a to-do list and I get this error msg:Uncaught TypeError: Cannot read properties of null (reading 'addEventListener').
I have looked through the code many times and I am unable to see what the problem is.
Here is my HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>To Do List</title>
<link rel="stylesheet" href="ToDoList.CSS">
</head>
<body>
<section>
<h1>To Do List</h1>
<input type="text" id="userInputText">
<button id="button">Submit</button>
<p id="paragraph"></p>
</section>
<script src="ToDoList.JS"></script>
</body>
</html>
Here is my JS
let text = document.getElementById ('#userInputText');
let button1= document.getElementById ('#button');
let todolist = document.getElementById ('#paragraph');
function letsTry(){
todolist.innerHTML=text.value;
}
button1.addEventListener('Click', letsTry)