container
Type: {String|Object}
Default: document.body
Defines the container where selection is allowed.
You can pass either a CSS3 selector string or a node reference.
It's best to define the container as the closest ancestor to the items as possible and not have any other interactive elements (buttons, inputs, etc) within it as interacting with them will unselect the selectable items.
Example
new Selectable({
container: "#container"
});
// or
new Selectable({
container: document.getElementById("container")
});
The container can be updated dynamically with the setContainer()
method.
Last updated