I am trying to match text to an array with a pause between each iteration. Is my if statement and array match incorrect?
var animals = ["turtle", "dolfin"];
setTimeout(function() {
$("tr").each(function(){
if($(this).$("td:eq(0)").text().inArray(animals)){
$(this).$("button").hide();
}
else{
}
});
}, 5000);
<tr>
<td>turtle></td>
<td>lion</td>
<td><button>correct</button></td>
</tr>
<tr>
<td>cat></td>
<td>dog</td>
<td><button>correct</button></td>
</tr>
$(this).$("td:eq(0)")wut$(this).$("td:eq(0)")in the if statement. But thesetTimeout()will cause a 5 second delay between iterations, provided the syntax errors are fixed.