Reference select()

select()

Searches the page for the first element that matches the given CSS selector string.

The selector string can be an ID, class, tag name, or a combination. select() returns a p5.Element object if it finds a match and null if not.

The second parameter, container, is optional. It specifies a container to search within. container can be CSS selector string, a p5.Element object, or an HTMLElement object.

Examples

Syntax

select(selectors, [container])

Parameters

selectors

CSS selector string of element to search for.

container

CSS selector string, p5.Element, or HTMLElement to search within.

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

Related References