title: Append jQuery tabs inside a div that's created with javascript
body: <p>I want to use jQuery tabs (<a href="http://jsfiddle.net/43FcS/2/" rel="nofollow">http://jsfiddle.net/43FcS/2/</a>) inside a div that's created with javascript.</p>
  
  <p>Right now I'm creating a shop locator for a shop that I'm working at. I'm using the jQuery shop locator plugin, created by Bjorn (<a href="http://www.bjornblog.com/web/jquery-store-locator-plugin" rel="nofollow">http://www.bjornblog.com/web/jquery-store-locator-plugin</a>). </p>
  
  <p>When the user clicks search the search results (4 closest shops to the entered address) will be listed. In each li I thought of creating a div with a class "shoptab". In each div I want to have the 2 tabs (address and opening hours) shown, as in the link above.
  My javascript creates the li with the following function:</p>
  
  <pre><code>$('&lt;li /&gt;').html("&lt;div class=\"shoptab\"&gt;&lt;h2 class=\"loc-name\"&gt; Shop " + storeName + "&lt;\/h2&gt; &lt;ul&gt;&lt;li&gt;&lt;a href=\"#tabs-1\"&gt;Address&lt;\/a&gt;&lt;\/li&gt; &lt;li&gt;&lt;a href=\"#tabs-2\"&gt;Opening hours&lt;\/a&gt;&lt;\/li&gt;&lt;\/ul&gt; &lt;div id=\"tabs-1\"&gt;&lt;p&gt;" + storeAddress1 + "&lt;\/p&gt; &lt;p&gt;" + storeAddress2 + "&lt;\/p&gt; &lt;p&gt;" + storeCity + ", " + storeState + " " + storeZip + "&lt;\/p&gt; &lt;p&gt;" + storePhone + "&lt;\/p&gt; &lt;\/div&gt; &lt;div id=\"tabs-2\"&gt;&lt;p&gt;" + storeHours1 + "&lt;\/p&gt; &lt;p&gt;" + storeHours2 + "&lt;\/p&gt; &lt;p&gt;" + storeHours3 + "&lt;\/p&gt; &lt;\/div&gt;&lt;\/div&gt;")
  </code></pre>
  
  <p>I know I cannot use the ids tabs-1 and tabs-2 as they would be used several times, but for now I just wanted them to atleast show up and then afterwards adjust the code to give the div's ids 1,2,3,4 etc.</p>
  
  <p>My function to the jQuery tabs is written at the bottom of the document together with my shoplocator function.</p>
  
  <pre><code>$(function() {
          $(".shoptab").tabs();
      });
  </code></pre>
  
  <p>The jQuery ui script doesn't apply the classes to the shoptab div and ul/li within and I can't figure out how to make it work.</p>
  
  <p>I hope with this information you can help me out. </p>