diff --git a/app/static/js/word_operation.js b/app/static/js/word_operation.js index 684d350..7ae32fc 100644 --- a/app/static/js/word_operation.js +++ b/app/static/js/word_operation.js @@ -60,7 +60,13 @@ function delete_word(theWord) { removeWord(theWord); } else { $("#p_" + theWord).remove(); - } + } + // remove highlighting for the word + let highlightedWords = document.querySelectorAll('.highlighted'); + for (let x of highlightedWords) { + if (x.innerHTML == word) + x.replaceWith(x.innerHTML); + } } }); }