title: Getting the contents of each bootstrap tab and printing them in separate divs?
body: <p>What I would like to do is get the contents of each bootstrap tab and print them in different divs. Basically, I would like to trigger the el.tab('show') function for each [data-toggle='tab'], grab the shown contents, and print them in different divs on the same page.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(function() {
  $('#myTab a').click(function (e) {
    e.preventDefault();
    $(this).tab('show');
  });
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.new
  {
    width: 30%;
    margin: 1%;
    border: 1px solid black;
    display: inline-block;
    min-height: 100px; 
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;meta name="viewport" content="width=device-width"&gt;
    &lt;title&gt;JS Bin&lt;/title&gt;
    &lt;script src="https://code.jquery.com/jquery.min.js"&gt;&lt;/script&gt;
  &lt;link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" /&gt;
  &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://code.jquery.com/jquery-3.1.0.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt; 
    &lt;ul class="nav nav-tabs"&gt;
    &lt;li&gt;&lt;a href="#home" data-toggle="tab"&gt;Home&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#profile" data-toggle="tab"&gt;Profile&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#messages" data-toggle="tab"&gt;Messages&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#settings" data-toggle="tab"&gt;Settings&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
    
    &lt;div class="tab-content"&gt;
    &lt;div class="tab-pane active" id="home"&gt;This is Home&lt;/div&gt;
    &lt;div class="tab-pane" id="profile"&gt;This is Profile&lt;/div&gt;
    &lt;div class="tab-pane" id="messages"&gt;This is Messages&lt;/div&gt;
    &lt;div class="tab-pane" id="settings"&gt;This is Settings&lt;/div&gt;
    &lt;/div&gt;
    
    &lt;div id="newHome" class='new'&gt;
      Want to print home content here
    &lt;/div&gt;
    &lt;div id="newProfile" class='new'&gt;
      Want to print profile content here
    &lt;/div&gt;
      &lt;div id="newMessages" class='new'&gt;
      Want to print messages content here
    &lt;/div&gt;
      &lt;div id="Settings" class='new'&gt;
      Want to print settings content here
    &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Example: <a href="http://jsbin.com/zixihexepu/edit?html,css,js,output" rel="nofollow noreferrer">http://jsbin.com/zixihexepu/edit?html,css,js,output</a></p>