// The first element's id
ele.id(): string | undefinedThe first element's id. Cached on the handle, so it stays readable after the element is removed.
Returns
string | undefinedthe id, or undefined when the collection is empty
eles.id — Collection > Metadata and identity. Cytoscape.js signatures, parameters and return contract.
eles.id — Collection › Metadata and identity
Preview · Collection › Metadata and identity
Read in the complete API reference · All API members
// The first element's id
ele.id(): string | undefinedThe first element's id. Cached on the handle, so it stays readable after the element is removed.
string | undefinedthe id, or undefined when the collection is empty