for loops

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

Thumbnail
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 Codepen.io
Copyright Edina ©
  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

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

<body>

  
  
  

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




</body>

</html>

/*Downloaded from https://www.codeseek.co/Edina/for-loops-aBBWWK */
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");
  }
}

Comments