title: Adding tinyMCE to dynamically added textarea
body: <p>I have some javascript that opens a lightbox which contains dynamically created HTML, including some textareas. I then do...</p>
  
  <pre><code>tinyMCE.init({mode: "none", theme: "simple"});
  tinymce.execCommand("mceAddControl", true, id);
  </code></pre>
  
  <p>...where <em>id</em> is the id of one textarea in particular. I know the id is correct, because that textarea disappears (it suddenly has <em>display:none</em> as an inline style?), but if I remove that inline style, the textarea appears again unchanged, but with no tinymce editor attached. Why is that inline style being applied, and why doesn't it have an attached editor?</p>
  
  <hr>
  
  <h2>Edit for Thariama</h2>
  
  <p>Edit 2 - code contained a bug, still doesn't work after fix though...</p>
  
  <p>Ok here is an example that shows the issue.</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;script src="jquery.js" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script src="tiny_mce.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;ul id="list"&gt;
          &lt;/ul&gt;    
      &lt;/body&gt;
  
      &lt;template id="thingyTemplate"&gt;
          &lt;li&gt;
              &lt;label&gt;Email rich text body:&lt;/label&gt;
              &lt;textarea rows="8" cols="50" path="bodyRichText" class="wysiwyg"&gt;&lt;/textarea&gt;
          &lt;/li&gt;
      &lt;/template&gt;
  
      &lt;script&gt;
  
          var newTemplate = $("#thingyTemplate &gt; *").clone();
          $(newTemplate).find("textarea").attr("id", "myTextArea");
          $("#list").append(newTemplate);
  
          tinyMCE.init({ mode: "none", theme: "simple" });
          tinymce.execCommand("mceAddControl", false, "myTextArea");
  
      &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When the page loads, you can see the <em>template</em> element but the clone()'d copy in the list disappears. If you remove the <em>mceAddControl</em> line however the template and its clone are visible.</p>