Closed FartuunH closed 9 months ago
del button is not deleting its adding space
function updateGuessed(letter) { const currentArr = getWordArr(); if(currentArr && currentArr.length < 5){ currentArr.push(letter) const SpaceEl = document.getElementById(String(space)); space = space + 1; SpaceEl.textContent = letter; }
its adding space
i don't know
created delete function `` function deleteLetter() { const currentArr = getWordArr();
if (currentArr && currentArr.length > 0) { const lastLetter = currentArr.pop(); const spaceEl = document.getElementById(String(space - 1)); space = space - 1; spaceEl.textContent = ''; } }
``
https://github.com/FartuunH/Wordle
console log the space el inside the delete function, specifically the spaceEl grabbed by this line:
const spaceEl = document.getElementById(String(space - 1));
share the results here
Thank you Tim, it worked
What's the problem you're trying to solve?
del button is not deleting its adding space
Post any code you think might be relevant (one fenced block per file)
If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?
its adding space
What is your best guess as to the source of the problem?
i don't know
What things have you already tried to solve the problem?
created delete function `` function deleteLetter() { const currentArr = getWordArr();
``
Paste a link to your repository here
https://github.com/FartuunH/Wordle