summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2022-04-18 19:44:12 +0800
committerFrederick Yin <fkfd@fkfd.me>2022-04-18 19:44:12 +0800
commit39a589d47c568dc53b7538811947b71bd66152d6 (patch)
tree75bddda0ed5720fd248b7b88cecc8723e0c3fb95
parent11d66c51f8b5e2cd9613a87637fbc700235f1687 (diff)
Show # of hints left
-rw-r--r--index.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/index.js b/index.js
index 79e0dd3..c201ba9 100644
--- a/index.js
+++ b/index.js
@@ -39,6 +39,7 @@ function newWord() {
wordElem.innerHTML = currentWord.word;
hintsLeft = 2;
+ hintElem.innerHTML = "Hint (2)";
// clean after the mess
for (let elem of [inputElem, nextElem, hintElem, showAnswerElem]) {
@@ -188,7 +189,9 @@ function hint() {
linesElem.innerHTML = hint;
hintElem.disabled = true;
}
+
hintsLeft--;
+ hintElem.innerHTML = `Hint (${hintsLeft})`;
}
function showAnswer() {