Q:

jQuery UI Selectable disable

Im using jQuery UI Selectable for list items in Ordered list, But i just want to disable only one list item from that ol, is their any way to do that?
here is my code
<ol id="selectable"> 
   <li>enable & selectable</li>
   <li>enable & selectable</li>
   <li>enable & selectable</li>
   <li>disable & not selctable</li>
</ol>
<script type="text/javascript">
   $( "#selectable" ).selectable();
</script>

A:

The Selectable widget provides a filter option that can be used to include children of the matched element:
$("#selectable").selectable({
    filter: ".something" //Give the elements to be selectable a class
});

Your HTML would then look something like this:
<ol id="selectable"> 
   <li class="something">enable & selectable</li>
   <li class="something">enable & selectable</li>
   <li class="something">enable & selectable</li>
   <li>disable & not selctable</li>
</ol>

Here's a working example.
If the li you want to exclude is always the last one, like in your example, you could avoid adding a class to each of the li elements and use the :not and :last selectors:
$("#selectable").selectable({
    filter: "li:not(:last)"
});

