Web-Dev-For-Beginners
Web-Dev-For-Beginners copied to clipboard
Fixed Issue #1346 child node selection, added last word handling, removed u…
…nnecessary span spaces, and added element existence checks
Description
This pull request addresses multiple issues in the typing game code, including:
- Child Node Selection:
- Replaced childNodes with children in quoteElement to ensure only element nodes are selected, avoiding interference from text nodes.
- Handling the Last Word:
- Added logic to handle the case when the last word is correctly typed. The game now displays a completion message and disables further input.
- UI Element Existence Check:
- Added checks to ensure quoteElement, messageElement, and typedValueElement exist in the DOM before manipulation, preventing potential runtime errors.
- Removed Extra Spaces in span Elements:
- Removed unnecessary spaces in generated elements for each word, ensuring accurate highlighting without display issues.
This PR has not seen any action for a while! Closing for now, but it can be reopened at a later date.
This PR has not seen any action for a while! Closing for now, but it can be reopened at a later date.