diff --git a/index.html b/index.html index 189be35..c2119e5 100644 --- a/index.html +++ b/index.html @@ -17,43 +17,43 @@

Word Master

- - - - - + + + + +
- - - - - + + + + +
- - - - - + + + + +
- - - - - + + + + +
- - - - - + + + + +
diff --git a/script.js b/script.js index 5178161..4ae38d0 100644 --- a/script.js +++ b/script.js @@ -181,6 +181,7 @@ document.addEventListener("keyup", (event) => { inputs[currentIndex].value = event.key.toUpperCase(); if ((currentIndex + 1) % 5 !== 0 && currentIndex < 25){ currentIndex++; + inputs[currentIndex].focus(); // Move focus to the next input } } @@ -189,6 +190,7 @@ document.addEventListener("keyup", (event) => { inputs[currentIndex].value = ""; } else if (currentIndex > minIndex) { currentIndex--; + inputs[currentIndex].focus(); inputs[currentIndex].value = ""; } } @@ -202,3 +204,7 @@ window.addEventListener("load", () => { loadcomplete(false) }); +inputs.forEach(input => { + input.readOnly = true; // Keeps the input focusable but prevents editing +}); +