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>
The Selectable widget provides a
filteroption that can be used to include children of the matched element:Your HTML would then look something like this:
Here’s a working example.
If the
liyou want to exclude is always the last one, like in your example, you could avoid adding a class to each of thelielements and use the:notand:lastselectors: