Demo of Selectable create event JQuery

  • Item 1
  • Item 2
  • Item 3
  • Item 4
  • Item 5
Press and hold Ctrl key for multiple selection


JQuery

$(document).ready(function() {
//////////////////////////
$('#b1').click(function(){
$( '#my_selectable' ).selectable({
create: function( event, ui ) {
$('#d1_create').html('CREATE : I am created, now you can select elements');	
}
});
})
///
$( "#my_selectable" ).on( "selectablecreate", function( event, ui ) {
$('#d1_event_listener').html('I am through event listener ');		
} );
///
})

HTML

<ul id="my_selectable">
  <li id=i1>Item 1</li>
  <li id=i2>Item 2</li>
  <li id=i3>Item 3</li>
  <li id=i4>Item 4</li>
  <li id=i5>Item 5</li>
</ul>

Press and hold <kbd>Ctrl</kbd> key for multiple selection<br>

<button type='button' class='btn btn-danger'  value='disable' id='b1'>Create selectable</button>