Lesson 5 – Engagement Activity
ENGAGEMENT
ENGAGEMENT ACTIVITY: Before going through the Javascript Looping, run and analyze
the program below. Open a Text Editor (notepad/Visual Studio Code/Sublime/Brackets) then
write the program below and save the file as “[Link]” and open the file in a browser.
Write your analyzation inside the box.
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript For Loop</h2>
<p id="demo"></p>
<script>
var cars = ["BMW", "Volvo", "Saab", "Ford", "Fiat", "Audi"];
var text = "";
var i;
for (i = 0; i < [Link]; i++) {
text += cars[i] + "<br>";
}
[Link]("demo").innerHTML = text;
</script>
</body>
</html>
It shows title JavaScript For Loop and under that title is a list of cars
BMW
Volvo
Ford
Fiat
Audi
Marawoy, Lipa City, Batangas 4217 | [Link]