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 element.

Returns

p5.Element: new p5.Element object.

Related References