var removeButton = document.getElementsByClassName('remove-btn')
console.log(removeButton)
for(var i = 0; i <= removeButton.length; i++){
var button = removeButton[i]
button.addEventListener('click',function(event) {
console.log('clicked')
var buttonClicked = event.target
buttonClicked.parentElement.parentElement.remove()
})
}
hello there,
I am very much new to javascript and the code that I have listed above should remove an item from the cart but my code does not enter the addEventListener method throwing back an error that says
Cannot Read property addEventListener of undeifined