Skip to content

Instantly share code, notes, and snippets.

@crissyg
Last active July 13, 2017 14:01
Show Gist options
  • Save crissyg/549d38b6ee256ca0a0454066676cc553 to your computer and use it in GitHub Desktop.
Save crissyg/549d38b6ee256ca0a0454066676cc553 to your computer and use it in GitHub Desktop.
Displays product of n * 2 .
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body>
<h1>Product!</h1>
<p id ="product"></p>
<script>
var p = "";
var i;
for (i = 1; i <=12; i++) {
p += "The product of " +i+" * "+" 2 = "+ i*2 + "<br>";
}
document.getElementById("product").innerHTML = p;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment