From d6bbd733d3d57dfd6fac50e241c1e8092ac6921b Mon Sep 17 00:00:00 2001 From: Kiju Lee <31754035+ekiju@users.noreply.github.com> Date: Mon, 29 Jan 2018 18:24:01 -0800 Subject: [PATCH] Update index.html --- index.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index b3625db..eb3b89e 100644 --- a/index.html +++ b/index.html @@ -32,9 +32,14 @@ function updateText() { - el.innerHTML = el.innerHTML+words[word_counter][character_counter++]; + var character = words[word_counter][character_counter++]; + if (character == " ") { + character = " "; + } + el.innerHTML += character; - if(character_counter == words[word_counter].length) + + if(character_counter > words[word_counter].length) { word_counter++; //choose a different word character_counter = 0; //start over with the first character of the word @@ -52,4 +57,4 @@ - \ No newline at end of file +