title: Adding tinymce editor script in a jquery dynamically
body: <p>I have this html page</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;jQuery add / remove textbox example&lt;/title&gt;
  
  &lt;script type="text/javascript" src="jquery-1.10.2.min.js"&gt;&lt;/script&gt;
  
  &lt;style type="text/css"&gt;
      div{
          padding:8px;
      }
  &lt;/style&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;h1&gt;jQuery add / remove textbox example&lt;/h1&gt;
  
  
  &lt;script type="text/javascript" src="tinymce\tinymce.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  
  tinymce.init({
          selector: "textarea",
          force_p_newlines : false,
  
  
          plugins: [
                  "advlist autolink autosave image link  lists charmap print preview hr anchor pagebreak spellchecker",
                  "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
                  "table contextmenu directionality emoticons template textcolor paste fullpage textcolor"
          ],
  
          toolbar1: "newdocument fullpage | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect formatselect fontselect fontsizeselect | cut copy paste | searchreplace | bullist numlist | outdent indent blockquote | undo redo | link unlink anchor image media | inserttime preview ",
          toolbar2: "forecolor backcolor | table | hr removeformat | subscript superscript | charmap emoticons | print fullscreen | ltr rtl | spellchecker | visualchars visualblocks nonbreaking template pagebreak restoredraft ",
  
          image_advtab: true,
          menubar: false,
          toolbar_items_size: 'small',
  
          style_formats: [
                  {title: 'Bold text', inline: 'b'},
                  {title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
                  {title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
                  {title: 'Example 1', inline: 'span', classes: 'example1'},
                  {title: 'Example 2', inline: 'span', classes: 'example2'},
                  {title: 'Table styles'},
                  {title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
          ],
  
          templates: [
                  {title: 'Test template 1', content: 'Test 1'},
                  {title: 'Test template 2', content: 'Test 2'}
          ]
  
  });
  &lt;/script&gt;
  
  
  &lt;script type="text/javascript"&gt;
  
  $(document).ready(function(){
  
      var counter = 2;
  
      $("#addButton").click(function () {
  
      if(counter&gt;4){
              alert("Only 4 textboxes allow");
              return false;
      }   
  
      var newTextBoxDiv = $(document.createElement('div'))
           .attr("id", 'TextBoxDiv' + counter);
  
      newTextBoxDiv.after().html('&lt;label&gt;Textbox #'+ counter + ' : &lt;/label&gt;' +
            '&lt;textarea name="textbox' + counter + 
            '" id="textbox' + counter + '" value="" /&gt;');
  
      newTextBoxDiv.appendTo("#TextBoxesGroup");
  
  
      counter++;
       });
  
       $("#removeButton").click(function () {
      if(counter==1){
            alert("No more textbox to remove");
            return false;
         }   
  
      counter--;
  
          $("#TextBoxDiv" + counter).remove();
  
       });
  
       $("#getButtonValue").click(function () {
  
      var msg = '';
      for(i=1; i&lt;counter; i++){
        msg += "\n Textbox #" + i + " : " + $('#textbox' + i).val();
      }
            alert(msg);
       });
    });
  &lt;/script&gt;
  &lt;/head&gt;&lt;body&gt;
  
  &lt;div id='TextBoxesGroup'&gt;
      &lt;div id="TextBoxDiv1"&gt;
          &lt;label&gt;Textbox #1 : &lt;/label&gt;&lt;textarea id='textbox1' &gt;&lt;/textarea&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;input type='button' value='Add Button' id='addButton'/&gt;
  &lt;input type='button' value='Remove Button' id='removeButton'/&gt;
  &lt;input type='button' value='Get TextBox Value' id='getButtonValue'/&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and this is the output.
  <img src="https://i.stack.imgur.com/FvRyi.jpg" alt="enter image description here"></p>
  
  <p>As you can see,I get the tinymce editor only the first time,i.e when i reload the page,but when I say add new,I just get a plain text editor.
  I need to add the tinymce script in the jquery but where and how should i add it?</p>