I have started making a shopping cart, but there’s a problem with my code that when I try to delete a row by button “X” it doesn’t work.
Code is below with HTML,CSS & JavaScript
Well, querySelector
will only grab a single element. You should look into querySelectorAll
which will be a NodeList. It returns an array-like object.
2 Likes
it worked thank you.
I thought “querySelectorAll” I should use when I have multiple images, but is the reason that I have multiple classes on my parent div and that’s why i need to use querySelectorAll ?