Skip to content

Instantly share code, notes, and snippets.

@wismer
Created April 24, 2017 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wismer/503464d1419d44899116ecdf122d924c to your computer and use it in GitHub Desktop.
Save wismer/503464d1419d44899116ecdf122d924c to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=503464d1419d44899116ecdf122d924c
<!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 count = 0; count < 6; count = count + 1){
//prints hello to the page body
$("body").append("<p>" + count + "</p>");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment