jQuery reorder list items based on class
You can prepend the .featured
elements to their containing ul
to move them to the top of the list. Try this:
$('.featured').prependTo('.order-me');
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<ul class="order-me">
<li class="">normal content</li>
<li class="">normal content</li>
<li class="featured">featured content</li>
<li class="">normal content</li>
<li class="featured">featured content</li>
<li class="">normal content</li>
<li class="">normal content</li>
</ul>