title: Materialize css - dynamically load tabs element
body: <p>I am dynamically creating a set of <a href="http://materializecss.com/tabs.html" rel="nofollow">tabs</a> on page load, but it is not being picked up when I run the <code>on</code> function. How can I get it working? This is my code so far:</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div class="row"&gt;
      &lt;div class="col s12"&gt;
        &lt;ul class="tabs"&gt;
          &lt;li class="tab col s3"&gt;&lt;a href="#test1"&gt;Test 1&lt;/a&gt;&lt;/li&gt;
          &lt;li class="tab col s3"&gt;&lt;a class="active" href="#test2"&gt;Test 2&lt;/a&gt;&lt;/li&gt;
          &lt;li class="tab col s3"&gt;&lt;a href="#test3"&gt;Test 3&lt;/a&gt;&lt;/li&gt;
          &lt;li class="tab col s3"&gt;&lt;a href="#test4"&gt;Test 4&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div id="test1" class="col s12"&gt;Test 1&lt;/div&gt;
      &lt;div id="test2" class="col s12"&gt;Test 2&lt;/div&gt;
      &lt;div id="test3" class="col s12"&gt;Test 3&lt;/div&gt;
      &lt;div id="test4" class="col s12"&gt;Test 4&lt;/div&gt;    
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>$('body').on('load', 'ul.tabs', function() {
      $('ul.tabs').tabs()
  });
  </code></pre>
  
  <p>Thanks</p>