I need assistance in verifying the accuracy of an input and moving on to the next word if it's incorrect.
"Apples",
"Bananas",
"Pears",
"Door",
"Towel",
"Computer",
];
var x = myArray[Math.floor(Math.random()*myArray.length)];
function clearbox(){
if (x = myInput.value){
var x = myArray[Math.floor(Math.random();*myArray.length)]);
document.getElementById('myInput').value = ''
document.getElementById("word").innerHTML = x
} else {
document.getElementById('myInput').value = '' ;
}
};
It seems that the if statement is not working properly, could someone kindly assist me with this issue?