From 4cde454fa0b7bd66bd58309e17fea8f10b659c78 Mon Sep 17 00:00:00 2001 From: "1994836463@qq.com" Date: Mon, 20 May 2024 14:08:33 +0800 Subject: [PATCH] change2 --- app/static/js/fillword.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/static/js/fillword.js b/app/static/js/fillword.js index b967633..8172622 100644 --- a/app/static/js/fillword.js +++ b/app/static/js/fillword.js @@ -10,6 +10,12 @@ function fillInWord() { if (isRead) Reader.read(word, inputSlider.value); if (!isChoose) return; const element = document.getElementById("selected-words"); + let element1 = document.getElementById("selected-words"); + let index = (String)(element1.value).indexOf(word); + localStorage.setItem("nowWord",element1.value); + if(index === -1){ + element1.value = element1.value + " " + word; + } element.value = element.value + " " + word; }