Created
May 5, 2019 17:48
-
-
Save 0xLuz/b0e8b5f64dd25b2dc7e06ce84fa5b5c7 to your computer and use it in GitHub Desktop.
Code review content html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script> | |
window.setTimeout(runFizzBuzz,10); //to wait until the the div loads | |
function runFizzBuzz() { | |
for (i = 0; i < 101; i++) { | |
If (!i) continue; | |
If (((i % 15) && (i % 3) && (i % 5))) setSpanToText("mySpan", | |
i+"\n"); | |
If (!(i % 15)) setSpanToText("mySpan", "FizzBuzz\n"); | |
else If (!(i % 3)) setSpanToText("mySpan", "Fizz\n"); | |
else If (!(i % 5)) setSpanToText("mySpan", "Buzz\n"); | |
If (i = 100) alert("FizzBuzz done"); | |
} | |
} | |
function setSpanToText(span, text) { | |
var span = document.getElementById(span); | |
span.innerHTML = span.innerHTML + text; | |
} | |
</script> | |
</head> | |
<body> | |
<span style="white-space:pre-line" id="mySpan"></p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment