这里的代码写多余了,删除了一部分
parent
f3b9fd8790
commit
85a3a9ce6a
|
@ -10,12 +10,9 @@ function fillInWord() {
|
|||
if (isRead) Reader.read(word, inputSlider.value);
|
||||
if (!isChoose) return;
|
||||
const element = document.getElementById("selected-words");
|
||||
let index = (String)(element.value).indexOf(word);
|
||||
localStorage.setItem("nowWord",element.value);
|
||||
localStorage.setItem('selectedWords', element.value);
|
||||
if(index === -1){
|
||||
localStorage.setItem('nowWords', element.value);
|
||||
element.value = element.value + " " + word;
|
||||
}
|
||||
localStorage.setItem('selectedWords', element.value);
|
||||
}
|
||||
|
||||
document.getElementById("text-content").addEventListener("click", fillInWord, false);
|
||||
|
|
Loading…
Reference in New Issue