title: Set focus to jHtmlArea jQuery plugin
body: <p>I'm using the jHtmlArea jQuery plugin on my page and I'm making it visible onClick of a button. Now I'm trying to place the focus into the jHtmlArea editor once it's displayed, but just can't seem to get there.</p>
  
  <p>I did find this blog post <a href="http://www.theruntime.com/blogs/thomasswilliams/archive/2009/05/28/setting-focus-to-control-in-an-iframe-using-jquery.aspx" rel="nofollow noreferrer">Setting Focus to Control in an IFRAME using jQuery</a> which is talking about setting focus to an element inside the IFrame that the thickbox plugin utilizes by setting focus to the IFrame first then to the element, but jHTMLArea doesn't place any elements into its IFrame.</p>
  
  <p>So either I'm not properly selecting the IFrame's body element or calling <code>.focus()</code> to the body is doing nothing for me.</p>
  
  <p>Here's the output that jHtmlArea is generating:</p>
  
  <pre><code>&lt;div class="jHtmlArea" style="width: 498px;"&gt;
    &lt;div class="ToolBar" style="width: 496px;"&gt;
      &lt;ul&gt;
        ... removed toolbar code for briefness
      &lt;/ul&gt;
    &lt;/div&gt;
    &lt;div&gt;
      &lt;iframe style="height: 256px; width: 494px;"&gt;
        &lt;html&gt;
          &lt;head&gt;
            &lt;link rel="stylesheet" type="text/css" href="jHtmlArea.Editor.css"&gt;&lt;/link&gt;
          &lt;/head&gt;
          &lt;body&gt;
             &lt;br _moz_editor_bogus_node="TRUE" _moz_dirty=""/&gt;
          &lt;/body&gt;
        &lt;/html&gt;
      &lt;/iframe&gt;
    &lt;/div&gt;
    &lt;textarea id="TxtAreaDescription" rows="15" cols="60" name="TxtAreaDescription" style="display: none;"/&gt;
  </code></pre>
  
  <p>Here's some of what I've tried:</p>
  
  <pre><code>var iframe = $("iframe");
  if (iframe != null) {
      $(iframe).focus();
      $(iframe).contents().find("body").focus();
  }
  </code></pre>
  
  <p>Thanks for any help you can pass on.</p>