#ele.selected()
// Whether the first element is selected
ele.selected(): booleanWhether the first element is selected.
booleantrue when selected
Inspect and change element selection and selectability.
ele.selected()// Whether the first element is selected
ele.selected(): booleanWhether the first element is selected.
booleantrue when selected
ele.selectable()// Whether the first element may be selected by the user
ele.selectable(): booleanWhether the first element may be selected by the user. The graph-wide cy.autounselectify() overrides this for user gestures.
booleantrue when selectable
eles.select()// Select every selectable element, emitting select for each one that changed
eles.select(): thisSelect every selectable element, emitting a select event for each one that changed. Unselectable elements are skipped.
thisthis collection, for chaining
Example
const node = cy.getElementById('a');node.select();console.log(node.selected()); // trueeles.unselect()// Deselect every element, emitting unselect for each one that changed
eles.unselect(): thisDeselect every element, emitting an unselect event for each one that changed.
thisthis collection, for chaining
Example
const node = cy.getElementById('a');node.unselect();console.log(node.selected()); // falseAlso spelled eles.deselect.
eles.selectify()// Make these elements selectable
eles.selectify(): thisMake these elements selectable.
thisthis collection, for chaining
Example
const node = cy.getElementById('a');node.selectify();console.log(node.selectable()); // trueeles.unselectify()// Make these elements unselectable
eles.unselectify(): thisMake these elements unselectable. Does not deselect them; call unselect() for that.
thisthis collection, for chaining
Example
const node = cy.getElementById('a');node.unselectify();console.log(node.selectable()); // false