Perform action in series <p>i am trying to perform action in series but here in my code alert message is printed firat though i have written it after some action.</p> <p>This is Fiddle i have Tried . <a href="http://jsfiddle.net/wggua/635/" rel="nofollow">http://jsfiddle.net/wggua/635/</a></p> <pre><code> $(document).ready(function() { var a=1; setTimeout(function() { $('#dvData').fadeOut(); }, 2000); if(a==1) { alert("value i s 1"); } else { alert("value is 0"); } }); </code></pre> <p>Please help,</p>