Hello,
I keep getting “undefined”, and don’t know why is it, I know the error is somewhere at “deleteButton()” but everything looks good to my nub eyes,
I’m missing something?
const input = document.querySelector('input');
const button = document.querySelector('.button');
const theList = document.querySelector('ul');
function addingToList() {
let itemList = document.createElement('li');
theList.appendChild(itemList);
let userItem = input.value;
function deleteButton() {
let delB = document.createElement('button');
delB.id = 'delete-el';
delB.textContent = 'Delete';
theList.appendChild(delB);
}
itemList.textContent = userItem + ' ' + deleteButton();
}
Sorry, that took so long, but I think I got it figured out. Had nothing to do with input it had to do with the + " " + you were using. If you get rid of those and left the code to look like