Exécuter
❯
Exécuter le code
Ctrl+Alt+R
Sauvegarder le code
Ctrl+Alt+A
Changer d'orientation
Ctrl+Alt+O
Changer de thème
Ctrl+Alt+D
<!DOCTYPE html> <html> <head> <script> function showDetails(animal) { let animalType = animal.getAttribute("data-animal-type"); alert("Le " + animal.innerHTML + " est un " + animalType + "."); } </script> </head> <body> <h1>Espèces</h1> <p>Cliquez sur une espèce pour voir de quel type il s'agit :</p> <ul> <li onclick="showDetails(this)" id="owl" data-animal-type="bird">Hibou</li> <li onclick="showDetails(this)" id="salmon" data-animal-type="fish">Saumon</li> <li onclick="showDetails(this)" id="tarantula" data-animal-type="spider">Tarantule</li> </ul> </body> </html>