Cloning HTML and replacing the content id according to the tab selected
<p>I have three Tabs "B1", "B2", and  "B3". I want to clone this HTML and load it as the content of three tabs with ids <code>id = "bv-B1-p1"</code>, <code>id = "bv-B2-p1"</code>, and <code>id = "bv-B3-p1"</code> (i.e. replacing <code>-brand-</code> with <code>B1</code> , <code>B2</code> or <code>B3</code> in accordance with the tab selected).</p>

<pre><code>&lt;div id="bv-brand-priority"&gt;    
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#bv-brand-hp"&gt;&lt;span&gt;Static Tab&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a id="addTab" href="#" &gt;&lt;span&gt;+&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div id="bv-brand-hp"&gt;
    &lt;/div&gt;
    &lt;div id="bv-brand-p"&gt;
           &lt;div id="bv-brand-eng-media-image-p-img"&gt;

            &lt;/div&gt;    
        &lt;!--clicking this link should append another similar div to the  above div with incremented id i.e id="bv-brand-eng-media-image-p-img1"--&gt;           

        &lt;a href="#" id='bv-brand-eng-add-media-image-p'&gt;Add New Image&lt;/a&gt;

    &lt;/div&gt;
&lt;/div&gt;   

&lt;/div&gt;
</code></pre>
