Class Dom

Index

Methods

addClass

  • addClass(classNames: string[]): void

append

  • append(element: HTMLElement): void

canHandleEvent

  • canHandleEvent(eventName: string): boolean

children

  • children(): HTMLElement[]

clone

  • clone(deep?: boolean): Dom

closest

  • closest(className: string): HTMLElement

css

  • css(property: string): string

detach

  • detach(): void

empty

  • empty(): void

find

  • find(selector: string): HTMLElement

findAll

  • findAll(selector: string): HTMLElement[]

findClass

  • findClass(className: string): HTMLElement[]

findId

  • findId(id: string): HTMLElement

focus

  • focus(preserveScroll: boolean): void

getAttribute

  • getAttribute(name: string): string

getClass

  • getClass(): string[]

hasClass

  • hasClass(className: string): boolean

height

  • height(): number

hide

  • hide(): void

insertAfter

  • insertAfter(refNode: HTMLElement): void

insertBefore

  • insertBefore(refNode: HTMLElement): void

is

  • is(selector: string): boolean

isDescendant

  • isDescendant(parent: HTMLElement): boolean

isEmpty

  • isEmpty(): boolean

isValid

  • isValid(): boolean

isVisible

  • isVisible(): boolean

off

  • off(types: string[], eventHandle: function): void
  • Parameters

    • types: string[]
    • eventHandle: function
        • (evt: Event, arg?: any): void
        • Parameters

          • evt: Event
          • Optional arg: any

          Returns void

    Returns void

offset

  • offset(): IOffset

offsetParent

  • offsetParent(): HTMLElement

on

  • on(types: string[], eventHandle: function): void
  • Parameters

    • types: string[]
    • eventHandle: function
        • (evt: Event, data: any): void
        • Parameters

          • evt: Event
          • data: any

          Returns void

    Returns void

one

  • one(types: string[], eventHandle: function): void
  • Parameters

    • types: string[]
    • eventHandle: function
        • (evt: Event, args?: any): void
        • Parameters

          • evt: Event
          • Optional args: any

          Returns void

    Returns void

parent

  • parent(className: string): HTMLElement

parents

  • parents(className: string): HTMLElement[]

position

  • position(): IOffset

prepend

  • prepend(toPrepend: HTMLElement): void

remove

  • remove(): void

removeClass

  • removeClass(className: string): void

replaceWith

  • replaceWith(otherElem: HTMLElement): void

setAttribute

  • setAttribute(name: string, value: string): void

setHtml

  • setHtml(html: string): void

show

  • show(): void

siblings

  • siblings(selector: string): HTMLElement[]

text

  • text(txt?: string): string

toggle

  • toggle(visible?: boolean): void

toggleClass

  • toggleClass(className: string, swtch?: boolean): void
  • Parameters

    • className: string
    • Optional swtch: boolean

    Returns void

trigger

  • trigger(type: string, data?: object): void
  • Parameters

    • type: string
    • Optional data: object
      • [key: string]: any

    Returns void

unhide

  • unhide(): void

width

  • width(): number

Static createElement

  • createElement(type: string, props?: Object, ...children: Array<string | HTMLElement | Dom>): HTMLElement
  • Parameters

    • type: string
    • Optional props: Object
    • Rest ...children: Array<string | HTMLElement | Dom>

    Returns HTMLElement

Static nodeListToArray

  • nodeListToArray(nodeList: NodeList): HTMLElement[]

Properties

Static useNativeJavaScriptEvents

useNativeJavaScriptEvents: boolean

Constructors

constructor

  • new Dom(el: HTMLElement): Dom

Hierarchy

  • Dom