Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Dom

Dom Helper

Hierarchy

  • Dom

Index

Methods

Static $1

  • Returns the first element that is a descendant of node that matches selectors.

    Parameters

    Returns HTMLElement

Static $L

  • Returns all element descendants of node that match selectors.

    Parameters

    • selector: string

    Returns NodeListOf<HTMLElement>

Static applyHtml

  • applyHtml(html: string | HTMLDocument, appendTo?: string | HTMLElement, ignore?: { css?: boolean; script?: boolean } | boolean): Promise<string>
  • Insert and apply a new HTML fragment in current page.

    Parameters

    • html: string | HTMLDocument
    • Optional appendTo: string | HTMLElement
    • Optional ignore: { css?: boolean; script?: boolean } | boolean

    Returns Promise<string>

Static applyStyle

  • applyStyle(code: string, id?: string): void
  • Apply css style code in current page.

    Parameters

    • code: string
    • Optional id: string

    Returns void

Static loadHTML

  • loadHTML(url: string, async?: boolean, opts?: { appendTo?: string | HTMLElement; ignore?: { css?: boolean; script?: boolean } | boolean; prehandle?: (doc: HTMLDocument) => HTMLDocument }): Promise<string>
  • Parameters

    • url: string
    • Optional async: boolean
    • Optional opts: { appendTo?: string | HTMLElement; ignore?: { css?: boolean; script?: boolean } | boolean; prehandle?: (doc: HTMLDocument) => HTMLDocument }
      • Optional appendTo?: string | HTMLElement
      • Optional ignore?: { css?: boolean; script?: boolean } | boolean
      • Optional prehandle?: (doc: HTMLDocument) => HTMLDocument
          • (doc: HTMLDocument): HTMLDocument
          • Parameters

            • doc: HTMLDocument

            Returns HTMLDocument

    Returns Promise<string>

Static rename

  • rename(node: Element, newTagName: string): void
  • Replace old node in DOM tree with new tag name.

    Parameters

    • node: Element
    • newTagName: string

    Returns void