Skip to content

Instantly share code, notes, and snippets.

@DestinyLuong
Created July 19, 2017 22:17
Show Gist options
  • Save DestinyLuong/963844832fa8a46bfea3d194ccb5e72f to your computer and use it in GitHub Desktop.
Save DestinyLuong/963844832fa8a46bfea3d194ccb5e72f to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=963844832fa8a46bfea3d194ccb5e72f
<!DOCTYPE html>
<html>
<head>
<title>For Loop do now</title>
</head>
<body>
<button>click here</button>
</body>
</html>
{"enabledLibraries":["jquery"]}
//button click handler
$("button").click(function(){
//for loop declaration
for(var beyonce = 1; beyonce < 101; beyonce = beyonce + 1){
//var pixels = 5;
// $("img").css("height" , "img + 5px");
//function pixels (x) {
//return x + 5;
//}
//prints hello to the page body
$("body").append("<img src= https://thetab.com/blogs.dir/91/files/2017/01/beyonce-super-bowl-50.jpg>");
}
});
//This code causes the numbers to count down in a list from a number to whatever number, when you press the button. There is a variable that.... But, you must add a 1 to the code, because a computer starts counting from 0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment