JavaScript: How can I remove the two "items" in the div "movieDivs"?

Hello,

I'm currently doing my IT homework, and unfortunately, I have a problem. This is the last problem before my assignment is finished. So please, I beg you, help me.

My codes:

HTML:

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>My favourite movies</title> <script defer src="./script.js"></script> </head> <body> </body> </html>

You can find JavaScript in the comments, the code is too long!

MY PROBLEM:

My problem is that when I click the "Delete Last" button, two "items" in the "movieDivs" div should be removed. Why two? Because I wrote my code unstructured from the start, and therefore the image and text belong together. For this reason, the "Movie Title" and the movie itself (i.e., the image) should also be deleted together!

I've tried everything, so I'm out of ideas now. Even this AI – ChatGPT – didn't help me! You're my only hope!

I hope for your helpful answers!

Kind regards

MrOsmo

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
2 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments