Skip to content

eles.hasElementWithId(id)

eles.hasElementWithId — Collection > Metadata and identity. Cytoscape.js signatures, parameters and return contract.

eles.hasElementWithId — Collection › Metadata and identity

Preview · Collection › Metadata and identity

Read in the complete API reference · All API members

// Whether this collection contains an element with the given id
eles.hasElementWithId(id: string): boolean

Whether this collection contains an element with the given id.

Parameters
NameDescription
id: string

the element id

Returns boolean

true when a member has that id

Example

console.log(eles.hasElementWithId('a')); // true

Example graph and handle setup