Skip to content

createSpanAsync

Creates a span asynchronously.

Import:

import { createSpanAsync } from '@mnaoumov/typescript-lib/html-element';

Signature:

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

Parameters:

Parameter Type Description
o string | CreateHtmlElementInfo | undefined The element information.
callback ((element: HTMLSpanElement) => Promisable<void>) | undefined The callback to call when the span is created.

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