How to programmatically select selectables with jQuery UI?

Here is a variation of Alex R’s code working with multiple elements http://jsfiddle.net/XYJEN/1/ function SelectSelectableElements (selectableContainer, elementsToSelect) { // add unselecting class to all elements in the styleboard canvas except the ones to select $(“.ui-selected”, selectableContainer).not(elementsToSelect).removeClass(“ui-selected”).addClass(“ui-unselecting”); // add ui-selecting class to the elements to select $(elementsToSelect).not(“.ui-selected”).addClass(“ui-selecting”); // trigger the mouse stop event (this will select … Read more