参考 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.

示例

语法

select(selectors, [container])

参数

selectors
String:

CSS selector string of element to search for.

container
String|p5.Element|HTMLElement:

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

返回值

p5.Element|null: p5.Element containing the element.
This page is generated from the comments in src/dom/dom.js . Please feel free to edit it and submit a pull request!

相关参考