diff --git a/index.html b/index.html index 4ef4a89..8b24d46 100644 --- a/index.html +++ b/index.html @@ -36,5 +36,9 @@

Hello World!

+ + + + diff --git a/js/fizzbuzz.js b/js/fizzbuzz.js new file mode 100644 index 0000000..ed7855f --- /dev/null +++ b/js/fizzbuzz.js @@ -0,0 +1,16 @@ +function fizzBuzz(N) { + for (var index = 1; index <= N; index++) { + if (index % 3 == 0 && index % 5 == 0) { + $(".container").append("

FizzBuzz

"); + } + else if (index % 3 == 0) { + $(".container").append("

Fizz

"); + } + else if (index % 5 == 0) { + $(".container").append("

Buzz

"); + } + else { + $(".container").append("

" + index + "

"); + } + } +}