id()

Sets the element's ID using a given string.

Calling myElement.id() without an argument returns its ID as a string.

Examples

Syntax

id(id)
id()

Parameters

id
String:

ID of the element.

Notice any errors or typos? Please let us know. Please feel free to edit src/core/p5.Element.js and open a pull request!

Related References