MCPcopy
hub / github.com/flatpickr/flatpickr / createElement

Function createElement

src/utils/dom.ts:10–24  ·  view source on GitHub ↗
(
  tag: keyof HTMLElementTagNameMap,
  className: string,
  content?: string
)

Source from the content-addressed store, hash-verified

8}
9
10export function createElement<T extends HTMLElement>(
11 tag: keyof HTMLElementTagNameMap,
12 className: string,
13 content?: string
14): T {
15 const e = window.document.createElement(tag) as T;
16 className = className || "";
17 content = content || "";
18
19 e.className = className;
20
21 if (content !== undefined) e.textContent = content;
22
23 return e;
24}
25
26export function clearNode(node: HTMLElement) {
27 while (node.firstChild) node.removeChild(node.firstChild);

Callers 12

buildFunction · 0.90
createDayFunction · 0.90
buildMonthDaysFunction · 0.90
buildMonthSwitchFunction · 0.90
buildMonthFunction · 0.90
buildMonthNavFunction · 0.90
buildTimeFunction · 0.90
buildWeekdaysFunction · 0.90
buildWeeksFunction · 0.90
setupInputsFunction · 0.90
setupMobileFunction · 0.90
createNumberInputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…