title: Twitter bootstrap - Focus on textarea inside a modal on click
body: <p>Just starting to play around with bootstrap and it's amazing. </p>
  
  <p>I'm trying to figure this out. I have a textarea for feedback inside a modal window. It works great. But I want the focus to go on the textarea when you click on the button to activate the modal. And I can't seem to get it working. </p>
  
  <p>Here is a fiddle: <a href="http://jsfiddle.net/denislexic/5JN9A/4/" rel="noreferrer">http://jsfiddle.net/denislexic/5JN9A/4/</a></p>
  
  <p>Here is the code:</p>
  
  <pre><code>&lt;a class="btn testBtn" data-toggle="modal" href="#myModal" &gt;Launch Modal&lt;/a&gt;
  
  &lt;div class="modal hide" id="myModal"&gt;
    &lt;div class="modal-header"&gt;
      &lt;button type="button" class="close" data-dismiss="modal"&gt;×&lt;/button&gt;
      &lt;h3&gt;Modal header&lt;/h3&gt;
    &lt;/div&gt;
    &lt;div class="modal-body"&gt;
        &lt;textarea id="textareaID"&gt;&lt;/textarea&gt;
    &lt;/div&gt;
    &lt;div class="modal-footer"&gt;
      &lt;a href="#" class="btn" data-dismiss="modal"&gt;Close&lt;/a&gt;
      &lt;a href="#" class="btn btn-primary"&gt;Save changes&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;​
  </code></pre>
  
  <p>Here is the JS</p>
  
  <pre><code>$('.testBtn').on('click',function(){
      $('#textareaID').focus();
  });​
  </code></pre>
  
  <p><strong>To resume</strong>
  When I click on "Launch modal" I want the modal to show up and the focus to go on the textarea.</p>
  
  <p>Thanks for any help.</p>