Dynamic List Fill (jQuery)
Quick and concise version.
$('a').click(function() {
$('ul').children().clone().appendTo('ul');
})
Of course, you can define your "a" and "ul" with a class or identifier to be more specific.
EDIT:
To expand the above disclaimer, this will be a somewhat fragile decision, as it will affect all elements "a" and "ul". Perhaps this is not the way you want.
- html- , .
:
$('#myPopulateAnchorElement').click(function() {
$('#myExpandableUL').children().clone().appendTo('#myExpandableUL');
});
<ul id='myExpandableUL'>
<li>item x</li>
<li>item y</li>
<li>item z</li>
</ul>
<a href="#" id='myPopulateAnchorElement'>Populate</a>
.