Remove an Element

PHOTO EMBED

Tue Aug 30 2022 02:55:16 GMT+0000 (Coordinated Universal Time)

Saved by @cruz #javascript

let elementToRemove = document.getElementById('vespa');
document.getElementById('italy-attractions').removeChild(elementToRemove);

<!DOCTYPE html>
<html>

<head>
  <title>Vacation World</title>
  <link href="style.css" type="text/css" rel="stylesheet">
</head>

<body>
 <img src="https://content.codecademy.com/courses/freelance-1/unit-2/explorer.jpeg" />
 <h1 class="title cursive capitalize" >Vacationing in Florence, Italy</h1>
 <h5>By: Ezio Auditore</h5>
 <h6 class="publish-time">Published: 2 Days Ago</h6>
 
 <p>Florence is full of fascinating places. Planning the perfect experience 'Di Firenze' involves researching reputable travel blogs, choosing the best season to travel, and being open to all that Florence has to offer.</p>
 <h2 class="destination">Florence's History</h2>
 <div class="description">A city-size shrine to the Renaissance, Florence offers frescoes, sculptures, churches, palaces, and other monuments from the richest cultural flowering the world has known. Names from its dazzling historical pastDante, Michelangelo, Galileo, Machiavelliare some of the most resonant of the medieval age. <a href="http://travel.nationalgeographic.com/travel/city-guides/florence-italy/" target="_blank">Learn More</a>.
   <h5>Top Attractions</h5>
   <ul id="italy-attractions">
     <li>Museums</li>
     <li>Bike Tours</li>
     <li>Historical Monuments</li>
     <li id="vespa">Rent a Vespa</li>
   </ul>
 </div>
</body>
  <script src="./main.js"></script>
</html>
content_copyCOPY

https://www.codecademy.com/courses/build-interactive-websites/lessons/javascript-dom/exercises/onclick-element