title: TinyMCE 4 : How to get the real HTML content from a page with many DIV inline editors on same page? (save to 1 file)
body: <p>In my CMS I have many DIVs on one HTML page with inline TinyMCE. Each DIV has it's own instance (#mce_0, and #mce_{randomnumber} )</p>
  
  <p>Every editable DIV is inside one wrapping DIV (not editable) with a specific ID (#MyWrapper).</p>
  
  <p><strong>Everything that is inside #MyWrapper (all the editor DIVs) should be saved to ONE file.</strong> </p>
  
  <p>When I use javascript to get the html from inside the #MyWrapper it works well, except that I get the HTML used inside the editor, in stead of the REAL HTML I want to have. For example iframes (YouTube-videos) are made into a example-image in stead of a real iframe. </p>
  
  <p>So, I have then tried to get the HTML code from the editors (same HTML as shown when you click on the "source code" inside the editor). </p>
  
  <p>But I haven't succeeded. </p>
  
  <p>Here is how my existing (working, but not getting the real HTML) script works:</p>
  
  <p>1) Get all HTML content in #MyWrapper</p>
  
  <p>2) Jquery: Add it to a non editable and hidden DIV called #ForSaving , so I can get easy access for saving it</p>
  
  <p>3) Then I have a javascript to save it to file. </p>
  
  <p>Today the task #1 (above) is solved using this:</p>
  
  <pre><code>jQuery("#ForSaving").html(jQuery(".MyWrapper").html());
  </code></pre>
  
  <p>BUT I should have a solution to get the real HTML from multiple inline editors in DIVs. </p>
  
  <p>I have tried tinymce.get('...'); etc, but I can not seam to get the HTML from multiple editors.</p>
  
  <p>Any help is appreciated. :-)</p>
  
  <p>Addition:
  I found this by searching for "tinymce multiple instances getcontent":
  <a href="https://stackoverflow.com/questions/16016250/how-to-get-tinymce-content-from-more-than-one-text-area">How to get tinyMCE content from more than one text area</a></p>
  
  <p>Thariama added a reply telling to use this: </p>
  
  <pre><code>for (i=0; i &lt; tinyMCE.editors.length; i++){
      var content = tinyMCE.editors[i].getContent();
      alert('Editor-Id(' + tinyMCE.editors[i].id + '):' + content);
  }
  </code></pre>
  
  <p>However I don't understand how to combine this with :</p>
  
  <pre><code>jQuery("#ForSaving").html(jQuery(".MyWrapper").html());
  </code></pre>
  
  <p>I am not very good at javascript-coding. </p>
  
  <p>I kindly ask you to help me combine these. Thank you :-)</p>