I have some jquery code that changes an element at intervals. It uses "setTimeout" to run a function every 1.5 seconds that changes the contents of a textarea. In this example, my code tries to fill the textarea with "one", then waits 1.5 seconds, then fills it with "two", then waits 1.5 seconds, the fills it with "three". But when I look at my screen, all I see is "three". I can understand why the screen would not refresh in the middle of a jquery function, but I'm using "setTimeout", so some of the time I would think jquery is not executing statements, but just waiting.
Here is the code:
$(document).ready(function () {
setTimeout(Fillfield1(),1500)
});
function Fillfield1() {
$("#TextAreaContent").text('one');
setTimeout(Fillfield2(), 1500)
}
function Fillfield2() {
$("#TextAreaContent").text('two');
setTimeout(Fillfield3(), 1500)
}
function Fillfield3() {
$("#TextAreaContent").text('three');
}
Thanks.