Instead document.querySelectorAll which return a collection you have to use document.querySelector(). Then it would work.
But if you have multiple delete Buttons then use: document.querySelectorAll. Afterwards you must iterate this collection to add an EventListener to every element.
const btns = document.querySelectorAll('.delete');
btns.forEach(b => b.addEventListener('click', () => {
// and action
}))