createDiv
Official
Creates a new <div> element.
Example:
createDiv({ text: 'foo' }, (div) => { div.createEl('strong', { text: 'bar' });});Signature:
function createDiv(o: string | DomElementInfo | undefined, callback: ((el: HTMLDivElement) => void) | undefined): HTMLDivElementParameters:
| Parameter | Type | Description |
|---|---|---|
o | string | DomElementInfo | undefined | The options object. |
callback | ((el: HTMLDivElement) => void) | undefined | A callback function to be called when the element is created. |
Returns: HTMLDivElement — The created element.
Example:
createDiv({ text: 'foo' }, (div) => { div.createEl('strong', { text: 'bar' });});Links to this page: