I want to change the background colour an input field if the value it contains is wrong. I can change the background colour but I want it to revert back to white after five secs. I've looked around and seen stuff like this, but it's not working. Any ideas?

Code:
function hint_btn(solution, grid, puzzleHolder)
{ 
	if(solution[0] == null)
	{
		alert("Please choose a game");
	}
	else
	{
		//alert("Arrrg");
		window.setTimeout( "hint_btn(solution, grid, puzzleHolder)", 5000);

		for(var i = 0; i < (grid.length+1); i++)
		{	
		
			var temp = document.getElementsByTagName("input");
				
			for(var q = 0; q < temp.length; q++)
				{
					//var temp2 = "<h6>" + solution[i] + "</h6>";
					var temp3 = temp[q].value; 	
					//&& temp3 != solution[i]
					if(temp3 != solution[i])
					{
								
						temp[q].style.backgroundColor = "red";
						//temp[q].value= solution[i];
					}
				}
			//alert(puzzleHolder[i]);
		}
	}
}