There is an icon between each sortable item , but not the last one, and of course the icon is non - sortable,
but from jquery UI example can't achieve the expect result
<ul id="sortable">
<li>itemA<p>-----</p></li>
<li>itemB<p>-----</p></li>
<li>itemC<p>-----</p></li>
<li>itemD</li>
</ul>
$("#sortable").sortable({
items: "> li"
});
https://jqueryui.com/resources/demos/sortable/items.html
Here is the jsfiddle, in this case the item D will always have no icon follow it but it doesn't necessarily the last one
https://jsfiddle.net/Lzp821qs/
Thanks a lot for helping.
Update:
Sorry for confusing, the case is like this:
first I have a list like
A
icon
B
icon
C
icon
D
Then I would like to make it sortable, but maintain the icon, eg. the A can switch with B , then it would be
B
icon
A
icon
C
icon
D