for loops

In this example below you will see how to do a for loops with some HTML / CSS and Javascript

This awesome code was written by Edina, you can see more from this user in the personal repository.
You can find the original code on
Copyright Edina ©
  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

  <meta charset="UTF-8">
  <title>for loops</title>



    <script  src="js/index.js"></script>



/*Downloaded from */
var question = prompt("Give me one of the 7 wonders of the ancient world!")
var the7wonders = ["Great Pyramid at Giza", "Hanging Gardens of Babylon", "Statue of Zeus at Olympia", "Temple of Arthemis at Ephesus", "Mausoleum at Halicarnassus", "Colossus of Rhodes", "Lighthouse at Alexandria"];
for (var i = 0; i < 7; i++) {
 if (question === the7wonders[i]) {
    alert("You are right");