execute flush javascript before finishing
<p>i've written a function which waits x milliseconds before executing another function. now i have problem with that it won't execute any change until it finishes.</p>

<pre><code>this.changeColor('#99FFCC');
this.pausecomp(this, 'changeColor','#FFFFFF', 1000);

changeColor = function (color)
{
    this.inputElem.style.backgroundColor = color;
};


pausecomp = function (element, meth, argument, ms)
{
    ms += new Date().getTime();
    while (new Date() &lt; ms) {}
    element[meth](argument);
}
</code></pre>

<p>this script will execute as expected but it won't change color until it finishes all. so firt color won't be displayed for 500ms ...</p>

<p>i can't use setTimeout() </p>

<p>my main goal is to blink textbox background so if there's a way to do this with css or any other please tell me.</p>

<p>Thanks</p>
