title: Why can't I focus a control that I reveal with slideDown()?
body: <p>I want to reveal a div with an input inside when you click a button, and set its focus.</p>
  
  <p>If I use show(), it works, but if I use slideDown() <strong>the focus is lost after the animation completes</strong>. How can I prevent this from happening?</p>
  
  <p>Sample code:</p>
  
  <pre><code>$("document").ready(function(){
      $("#MyButton").click(function(e){
          e.preventDefault();
          $(".SlidingDiv").slideDown();
          $("#MyInput").focus();
      });
  });
  
  &lt;input type="button" value="Click Me" id="MyButton" /&gt;
  &lt;div class="SlidingDiv" style="display:none;"&gt;&lt;input type="text" id="MyInput" /&gt;&lt;/div&gt;
  </code></pre>