summaryrefslogtreecommitdiff
path: root/js/wordsearch.js
diff options
context:
space:
mode:
authorSteven Thomas <[email protected]>2014-03-20 09:31:21 -0700
committerSteven Thomas <[email protected]>2014-03-20 09:31:21 -0700
commit6e28e7607bd492c960f40260d1de64e26652e2ba (patch)
tree7fa8829001f17556e5db156dd1fbe4e3f9f39c47 /js/wordsearch.js
parent726c52191b687252d447dd92122f74653c3271b8 (diff)
downloadword-search-game-6e28e7607bd492c960f40260d1de64e26652e2ba.tar.gz
word-search-game-6e28e7607bd492c960f40260d1de64e26652e2ba.zip
Updated lookup so that it crosses word off list if found.
Diffstat (limited to 'js/wordsearch.js')
-rw-r--r--js/wordsearch.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/js/wordsearch.js b/js/wordsearch.js
index 222b94f..17b54d8 100644
--- a/js/wordsearch.js
+++ b/js/wordsearch.js
@@ -330,6 +330,15 @@
el.classList.add('ws-found');
}
+
+ //Cross word off list.
+ var wordList = document.querySelector(".ws-words");
+ var wordListItems = wordList.getElementsByTagName("li");
+ for(var i=0; i<wordListItems.length; i++){
+ if(words[0].toLowerCase() == wordListItems[i].innerHTML.toLowerCase()){
+ wordListItems[i].innerHTML = "<del>"+wordListItems[i].innerHTML+"</del>";
+ }
+ }
}
}