# Class Dom

## Index

### Methods

- addClass
- append
- canHandleEvent
- children
- clone
- closest
- css
- detach
- empty
- find
- findAll
- findClass
- findId
- focus
- getAttribute
- getClass
- hasClass
- height
- hide
- insertAfter
- insertBefore
- is
- isDescendant
- isEmpty
- isValid
- isVisible
- off
- offset
- offsetParent
- on
- one
- parent
- parents
- position
- prepend
- remove
- removeClass
- replaceWith
- setAttribute
- setHtml
- show
- siblings
- text
- toggle
- toggleClass
- trigger
- unhide
- width
- createElement
- nodeListToArray

### Properties

- useNativeJavaScriptEvents

### Constructors

- constructor

## Methods

### addClass

- addClass(classNames: string[]): void

- - Defined in utils/Dom.ts :404

  #### Parameters

  - ##### classNames: string[]

  #### Returns void

### append

- append(element: HTMLElement): void

- - Defined in utils/Dom.ts :80

  #### Parameters

  - ##### element: HTMLElement

  #### Returns void

### canHandleEvent

- canHandleEvent(eventName: string): boolean

- - Defined in utils/Dom.ts :771

  #### Parameters

  - ##### eventName: string

  #### Returns boolean

### children

- children(): HTMLElement[]

- - Defined in utils/Dom.ts :340

  #### Returns HTMLElement[]

### clone

- clone(deep?: boolean): Dom

- - Defined in utils/Dom.ts :763

  #### Parameters

  - ##### Default value deep: boolean = false

  #### Returns Dom

### closest

- closest(className: string): HTMLElement

- - Defined in utils/Dom.ts :302

  #### Parameters

  - ##### className: string

  #### Returns HTMLElement

### css

- css(property: string): string

- - Defined in utils/Dom.ts :89

  #### Parameters

  - ##### property: string

  #### Returns string

### detach

- detach(): void

- - Defined in utils/Dom.ts :485

  #### Returns void

### empty

- empty(): void

- - Defined in utils/Dom.ts :147

  #### Returns void

### find

- find(selector: string): HTMLElement

- - Defined in utils/Dom.ts :268

  #### Parameters

  - ##### selector: string

  #### Returns HTMLElement

### findAll

- findAll(selector: string): HTMLElement[]

- - Defined in utils/Dom.ts :376

  #### Parameters

  - ##### selector: string

  #### Returns HTMLElement[]

### findClass

- findClass(className: string): HTMLElement[]

- - Defined in utils/Dom.ts :385

  #### Parameters

  - ##### className: string

  #### Returns HTMLElement[]

### findId

- findId(id: string): HTMLElement

- - Defined in utils/Dom.ts :396

  #### Parameters

  - ##### id: string

  #### Returns HTMLElement

### focus

- focus(preserveScroll: boolean): void

- - Defined in utils/Dom.ts :132

  #### Parameters

  - ##### preserveScroll: boolean

  #### Returns void

### getAttribute

- getAttribute(name: string): string

- - Defined in utils/Dom.ts :250

  #### Parameters

  - ##### name: string

  #### Returns string

### getClass

- getClass(): string[]

- - Defined in utils/Dom.ts :463

  #### Returns string[]

### hasClass

- hasClass(className: string): boolean

- - Defined in utils/Dom.ts :478

  #### Parameters

  - ##### className: string

  #### Returns boolean

### height

- height(): number

- - Defined in utils/Dom.ts :754

  #### Returns number

### hide

- hide(): void

- - Defined in utils/Dom.ts :187

  #### Returns void

### insertAfter

- insertAfter(refNode: HTMLElement): void

- - Defined in utils/Dom.ts :493

  #### Parameters

  - ##### refNode: HTMLElement

  #### Returns void

### insertBefore

- insertBefore(refNode: HTMLElement): void

- - Defined in utils/Dom.ts :501

  #### Parameters

  - ##### refNode: HTMLElement

  #### Returns void

### is

- is(selector: string): boolean

- - Defined in utils/Dom.ts :277

  #### Parameters

  - ##### selector: string

  #### Returns boolean

### isDescendant

- isDescendant(parent: HTMLElement): boolean

- - Defined in utils/Dom.ts :644

  #### Parameters

  - ##### parent: HTMLElement

  #### Returns boolean

### isEmpty

- isEmpty(): boolean

- - Defined in utils/Dom.ts :628

  #### Returns boolean

### isValid

- isValid(): boolean

- - Defined in utils/Dom.ts :636

  #### Returns boolean

### isVisible

- isVisible(): boolean

- - Defined in utils/Dom.ts :226

  #### Returns boolean

### off

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

- - Defined in utils/Dom.ts :580

  #### Parameters

  - ##### types: string[]

  - ##### eventHandle: function

    - - (evt: Event, arg?: any): void

      - #### Parameters

        - ##### evt: Event

        - ##### Optional arg: any

        #### Returns void

### offset

- offset(): IOffset

- - Defined in utils/Dom.ts :724

  #### Returns IOffset

### offsetParent

- offsetParent(): HTMLElement

- - Defined in utils/Dom.ts :706

  #### Returns HTMLElement

### on

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

- - Defined in utils/Dom.ts :522

  #### Parameters

  - ##### types: string[]

  - ##### eventHandle: function

    - - (evt: Event, data: any): void

      - #### Parameters

        - ##### evt: Event

        - ##### data: any

        #### Returns void

### one

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

- - Defined in utils/Dom.ts :558

  #### Parameters

  - ##### types: string[]

  - ##### eventHandle: function

    - - (evt: Event, args?: any): void

      - #### Parameters

        - ##### evt: Event

        - ##### Optional args: any

        #### Returns void

### parent

- parent(className: string): HTMLElement

- - Defined in utils/Dom.ts :312

  #### Parameters

  - ##### className: string

  #### Returns HTMLElement

### parents

- parents(className: string): HTMLElement[]

- - Defined in utils/Dom.ts :326

  #### Parameters

  - ##### className: string

  #### Returns HTMLElement[]

### position

- position(): IOffset

- - Defined in utils/Dom.ts :671

  #### Returns IOffset

### prepend

- prepend(toPrepend: HTMLElement): void

- - Defined in utils/Dom.ts :509

  #### Parameters

  - ##### toPrepend: HTMLElement

  #### Returns void

### remove

- remove(): void

- - Defined in utils/Dom.ts :170

  #### Returns void

### removeClass

- removeClass(className: string): void

- - Defined in utils/Dom.ts :426

  #### Parameters

  - ##### className: string

  #### Returns void

### replaceWith

- replaceWith(otherElem: HTMLElement): void

- - Defined in utils/Dom.ts :659

  #### Parameters

  - ##### otherElem: HTMLElement

  #### Returns void

### setAttribute

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

- - Defined in utils/Dom.ts :259

  #### Parameters

  - ##### name: string

  - ##### value: string

  #### Returns void

### setHtml

- setHtml(html: string): void

- - Defined in utils/Dom.ts :455

  #### Parameters

  - ##### html: string

  #### Returns void

### show

- show(): void

- - Defined in utils/Dom.ts :179

  #### Returns void

### siblings

- siblings(selector: string): HTMLElement[]

- - Defined in utils/Dom.ts :348

  #### Parameters

  - ##### selector: string

  #### Returns HTMLElement[]

### text

- text(txt?: string): string

- - Defined in utils/Dom.ts :101

  #### Parameters

  - ##### Optional txt: string

  #### Returns string

### toggle

- toggle(visible?: boolean): void

- - Defined in utils/Dom.ts :205

  #### Parameters

  - ##### Optional visible: boolean

  #### Returns void

### toggleClass

- toggleClass(className: string, swtch?: boolean): void

- - Defined in utils/Dom.ts :435

  #### Parameters

  - ##### className: string

  - ##### Optional swtch: boolean

  #### Returns void

### trigger

- trigger(type: string, data?: object): void

- - Defined in utils/Dom.ts :608

  #### Parameters

  - ##### type: string

  - ##### Optional data: object

    - ##### [key: string]: any

  #### Returns void

### unhide

- unhide(): void

- - Defined in utils/Dom.ts :195

  #### Returns void

### width

- width(): number

- - Defined in utils/Dom.ts :747

  #### Returns number

### Static createElement

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

- - Defined in utils/Dom.ts :50

  #### Parameters

  - ##### type: string

  - ##### Optional props: Object

  - ##### Rest ...children: Array<string | HTMLElement | Dom>

  #### Returns HTMLElement

### Static nodeListToArray

- nodeListToArray(nodeList: NodeList): HTMLElement[]

- - Defined in utils/Dom.ts :119

  #### Parameters

  - ##### nodeList: NodeList

  #### Returns HTMLElement[]

## Properties

### Static useNativeJavaScriptEvents

useNativeJavaScriptEvents: boolean

- Defined in utils/Dom.ts :27

## Constructors

### constructor

- new Dom(el: HTMLElement): Dom

- - Defined in utils/Dom.ts :29

  #### Parameters

  - ##### el: HTMLElement

  #### Returns Dom

### Hierarchy

- Dom