Creating time lag before a change of text.
I want the words "Daily Double" to appear when an element is clicked on. After about 4-5 seconds, the Jeopardy clue should appear and replace "Daily Double". I have come up with the following:
if (eventTarget.id=='51')
{
var display_clue=function(){
$(this).text("OFTEN CALLED THE WORST SUPREME COURT DECISION");
};
$(this).attr("id","daily_double").text("DAILY DOUBLE").setTimeout(display_clue,5000);
}
However, I notice that the text just stops at "DAILY DOUBLE" and never moves on to "OFTEN CALLED THE WORST SUPREME COURT DECISION".
How should I approach this?