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