Reference createSpan()

createSpan()

Creates a <span></span> element.

<span></span> elements are commonly used as containers for inline elements. For example, a <span></span> can hold part of a sentence that's a different style.

The parameter html is optional. It accepts a string that sets the inner HTML of the new <span></span>.

Examples

Syntax

createSpan([html])

Parameters

html
String:

inner HTML for the new <span></span> element.

Returns

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

Related References