Skip to content

createSpanAsync

Creates a span asynchronously.

Import:

import { createSpanAsync } from 'obsidian-dev-utils/html-element';

Signature:

function createSpanAsync(o: string | DomElementInfo | undefined, callback: ((element: HTMLSpanElement) => Promisable<void>) | undefined): Promise<HTMLSpanElement>

Parameters:

ParameterTypeDescription
ostring | DomElementInfo | undefinedThe element information.
callback((element: HTMLSpanElement) => Promisable<void>) | undefinedThe callback to call when the span is created.

Returns: Promise<HTMLSpanElement> — A Promise that resolves to the span.