educative.io

Educative

Where's the error?

// write your code here
var list = document.getElementById("#todoList");
var addButton = document.getElementById("#addTodo");
var item = document.getElementById("#todo");

addButton.onclick = function(item.value){
if (item.value != “”){
var newItem = document.createElement(‘li’);
newItem.innerHTML = item.value;
list.appendChild(newItem);
}
}

Can’t tell what I’m doing wrong - the above code doesn’t work. ):

Hello, change getElementById to querySelector