You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

14 lines
563 B

document.addEventListener('DOMContentLoaded', function() {
const animals = [
{ name: "Panda", description: "Giant panda native to China" },
{ name: "Giraffe", description: "The tallest land animal" },
{ name: "Elephant", description: "The largest land animal" }
];
const animalListElement = document.getElementById('animal-list');
animals.forEach(animal => {
const li = document.createElement('li');
li.textContent = `${animal.name} - ${animal.description}`;
animalList.appendChild(li);
});
});