Skip to main content

Exercise 29

  • Create the following folder/file structure:
/ex_29
|-- index.html

index.html

  • Create a basic HTML document
  • Create a script tag on the document head element
  • Add the following html code
<!DOCTYPE html>
<html>
<head>
<title>Products</title>
</head>
<body>
<ul>
<li>Bannana</li>
<li>Apple</li>
<li>Peach</li>
<li>Eggs</li>
<li>Tomatto</li>
<li>Lettuce</li>
<li>Milk</li>
</ul>
</body>
</html>
  • Select the ul element
  • Select each list item and assign it to a variable (use children property)
  • Remove each list item from the ul element using removeChild