Answer the question
In order to leave comments, you need to log in
Error when trying to change html text with React js, how to fix?
I'm trying to create an interactive leaderboard.
There was an idea: when you click on a cell, you could change the score.
However, this error pops up the
simplest function:
changeScore(e){
let target = e.target.id;
let a = prompt('Inter score', ' ');
taget.texContent = a;
}
Answer the question
In order to leave comments, you need to log in
I wouldn't recommend using React like this...
But try this:
changeScore(e){
e.target.textContent = prompt('Enter score', e.target.textContent);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question