what I am trying to do is generate an html list based from another list on the page. I have a list along the lines of below:
<ul>
<li class="chosen">content</li>
<li class="something">content</li>
<li class="something">content</li>
<li class="something">content</li>
<li class="something">content</li>
<li class="chosen">content</li>
<li class="chosen">content</li>
</ul>
Whats the best plan of action to create a jquery function which will find the list items with the class of “chosen” and create another list with just these.
Any help would be great. Thank you.
Select all the li elements with class
chosen, clone and append into a newuland finally append theulto a container whereever you want or pagebodyelement.Demo