Skip to content

createDivAsync

Creates a div asynchronously.

Import:

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

Signature:

function createDivAsync(o: string | DomElementInfo | undefined, callback: ((el: HTMLDivElement) => Promisable<void>) | undefined): Promise<HTMLDivElement>

Parameters:

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

Returns: Promise<HTMLDivElement> — A Promise that resolves to the div.