How to exclude an element from being dragged in sortable list?
You need to use cancel.
See working example here.
Js:
$(function() { $('.sortable').sortable(); $('.sortable').disableSelection(); $('.sortable').sortable({ cancel: '.note' });});
As @Zephyr points out, this let's you re-arrange the position by dragging the siblings, if you want to avoid that, use owise1 approach:
$('.sortable').sortable({ items : ':not(.note)'});
You could use sortable's "items" option:
$( ".sortable" ).sortable({ items : 'li'});
or...
$( ".sortable" ).sortable({ items : ':not(.note)'});
You can explicitly exclude items with:
$( ".sortable" ).sortable({ cancel: ".disable-sorting"});