So this is the functionality I need to clear:
I need to create a function in which viewers can click any word in a sentence and it will be highlighted. However, I need to make sure that only one word stands out at a time. For example, if you press the word “you,” and then change your mind and press the word “eagle,” then the word “you” will be canceled.
We already have the code, but we are working in a very short time, and if we make changes and adjustments using this extremely long, extremely difficult to navigate code, then we will use so many precious weeks that produce a single 5-minute interactivity.
Here's what it looks like:

And this is a JS snippet (so you can see the problem):

( HTML JS )
, , , , , , - , . , for, , arrayName [i] . , , if-else, .
HTML , , <p> <div id="sentence1"> - , ... , , , , , - .
, , JavaScript , , ! , .
! , !
checkAns(). var correct, , checkAns(). .
function checkAns(){
document.getElementById('alertMsg').style.visibility = "hidden";
if(Ans1B == "selected"){
correct++
document.getElementById('marksymbol1').className = "smile";
}
else
{
document.getElementById('marksymbol1').className = "sad";
}
if(Ans2A == "selected"){
correct++
document.getElementById('marksymbol2').className = "smile";
}
else
{
document.getElementById('marksymbol2').className = "sad";
}
if(Ans3A == "selected"){
correct++
document.getElementById('marksymbol3').className = "smile";
}
else
{
document.getElementById('marksymbol3').className = "sad";
}
if(Ans4A == "selected"){
correct++
document.getElementById('marksymbol4').className = "smile";
}
else
{
document.getElementById('marksymbol4').className = "sad";
}
if(Ans5A == "selected"){
correct++
document.getElementById('marksymbol5').className = "smile";
}
else
{
document.getElementById('marksymbol5').className = "sad";
}