One issue I encountered in this code snippet is that the 'questions' array is empty. I expected the 'ol li' selector to target all list items within ordered lists. Another problem I faced was the inability to assign an id to the array, as seen in the first line of code within the for loop.
function setUp()
{
var questions = document.querySelectorAll('ol li');
/*var questions = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];*/
for (var x = 0; x < questions.length; x++)
{
questions[x].id = x + 'phrase';
onmousedown(showEnglish(questions));
onmouseup(showFrench(questions));
onmouseover.style.cursor = 'pointer';
}
}
function showEnglish()
{
var phraseNumber = parseInt(parent.questions.id);
document.getElementsById(phraseNumber).innerHTML = english[phraseNumber];
english[phraseNumber].style.fontStyle = 'italic';
english[phraseNumber].style.color = 'rgb(191,22,31)';
}