I have an HTML page with the following div tags
<div data-role="page" id="pageHome" data-theme="a">
<div data-role="content">
<center>
<h3><a href="#pageHome" data-role="none"><img src="images/logo.png" /></a></h3>
</center>
<div class="dydivarr0"> </div>
<br />
<div data-role="controlgroup" class="ui-btn-right"> <a href="#page1" data-role="button">Next</a> </div>
</div>
</div>
<div data-role="page" id="page1" data-theme="a">
<div data-role="content">
<center>
<h3><a href="#pageHome" data-role="none"><img src="images/logo.png" /></a></h3>
</center>
<div class="dydivarr1"> </div>
<br />
<div data-role="controlgroup" class="ui-btn-right"> <a href="#page2" data-role="button">Next</a> </div>
</div>
</div>
<div data-role="page" id="page2" data-theme="a">
<div data-role="content">
<center>
<h3><a href="#pageHome" data-role="none"><img src="images/logo.png" /></a></h3>
</center>
<div class="dydivarr2"> </div>
<br />
<div data-role="controlgroup" class="ui-btn-right"> <a href="#page3" data-role="button">Next</a> </div>
</div>
dydivarr is generated dynamically from web a response using JSON. Using that response I create dynamic div content, next I want to repeat that div as shown above. Is there any better way than to repeat static html code? I guess there must be few jQuery or JavaScript tricks for that.
Any help would be appericiated.
Something like this? Sample Fiddle
So you want cloneNode of your div, so try something like this
How can I replicate a div a certain number of times based on a select-box value?
Roko C. Buljan
And
Vivin Paliath
's Answers
Update :
Simple Code worked. It was just my wrong approach
Thanks