DomElementBuilder class
- addChild
- addChildElement
- addClass
- addHtml
- addText
- appendTo
- attr
- clear
- data
- hide
- html
- id
- isVisible
- off
- on
- removeClass
- removeStyle
- setStyle
- show
- text
- title
- toDOM
- toggleClass
- visible
Constructors
Section titled “Constructors”constructor
Section titled “constructor”⊕ new DomElementBuilder(tag: string
| TElement
,parent?: HTMLElement
): DomElementBuilder
Parameters:
Section titled “Parameters:”- tag:
string
|TElement
- parent:
HTMLElement
, Optional
Protected Properties
Section titled “Protected Properties”element
Section titled “element”● element: TElement
Public Methods
Section titled “Public Methods”addChild
Section titled “addChild”▸ addChild(tag: "div"
,childBuilder?: (builder: DomElementBuilder<HTMLDivElement
>) => void
): this
Parameters:
Section titled “Parameters:”- tag:
"div"
- childBuilder: (builder: DomElementBuilder<
HTMLDivElement
>) =>void
, Optional
Returns this
▸ addChild(tag: "button"
,childBuilder?: (builder: DomElementBuilder<HTMLButtonElement
>) => void
): this
Parameters:
Section titled “Parameters:”- tag:
"button"
- childBuilder: (builder: DomElementBuilder<
HTMLButtonElement
>) =>void
, Optional
Returns this
▸ addChild(tag: "a"
,childBuilder?: (builder: DomElementBuilder<HTMLAnchorElement
>) => void
): this
Parameters:
Section titled “Parameters:”- tag:
"a"
- childBuilder: (builder: DomElementBuilder<
HTMLAnchorElement
>) =>void
, Optional
Returns this
▸ addChild(tag: "img"
,childBuilder?: (builder: DomElementBuilder<HTMLImageElement
>) => void
): this
Parameters:
Section titled “Parameters:”- tag:
"img"
- childBuilder: (builder: DomElementBuilder<
HTMLImageElement
>) =>void
, Optional
Returns this
▸ addChild(tag: "input"
,childBuilder?: (builder: DomInputElementBuilder) => void
): this
Parameters:
Section titled “Parameters:”- tag:
"input"
- childBuilder: (builder: DomInputElementBuilder) =>
void
, Optional
Returns this
▸ addChild(tag: "select"
,childBuilder?: (builder: DomSelectElementBuilder) => void
): this
Parameters:
Section titled “Parameters:”- tag:
"select"
- childBuilder: (builder: DomSelectElementBuilder) =>
void
, Optional
Returns this
▸ addChild(tag: string
,childBuilder?: (builder: DomElementBuilder<HTMLElement
>) => void
): this
Parameters:
Section titled “Parameters:”- tag:
string
- childBuilder: (builder: DomElementBuilder<
HTMLElement
>) =>void
, Optional
Returns this
addChildElement
Section titled “addChildElement”▸ addChildElement(element: HTMLElement
): this
Parameters:
Section titled “Parameters:”- element:
HTMLElement
Returns this
addClass
Section titled “addClass”▸ addClass(className: string
,classNames: string
[]): this
Parameters:
Section titled “Parameters:”- className:
string
- classNames:
string
[]
Returns this
addHtml
Section titled “addHtml”▸ addHtml(html: string
): this
Parameters:
Section titled “Parameters:”- html:
string
Returns this
addText
Section titled “addText”▸ addText(text: string
): this
Parameters:
Section titled “Parameters:”- text:
string
Returns this
appendTo
Section titled “appendTo”▸ appendTo(parent: HTMLElement
): this
Parameters:
Section titled “Parameters:”- parent:
HTMLElement
Returns this
▸ attr(attrId: string
,attrValue: string
): this
Parameters:
Section titled “Parameters:”- attrId:
string
- attrValue:
string
Returns this
▸ clear(): void
Returns void
▸ data(dataId: string
,dataValue?: string
): this
Parameters:
Section titled “Parameters:”- dataId:
string
- dataValue:
string
, Default value =null
Returns this
▸ hide(toHide?: boolean
): this
Parameters:
Section titled “Parameters:”- toHide:
boolean
, Default value =true
Returns this
▸ html(html: string
): this
Parameters:
Section titled “Parameters:”- html:
string
Returns this
▸ id(value: string
): this
Parameters:
Section titled “Parameters:”- value:
string
Returns this
isVisible
Section titled “isVisible”▸ isVisible(): boolean
Returns boolean
▸ off(eventType: string
,listener: (event: Event
, options?: boolean
| AddEventListenerOptions
) => any
): this
Parameters:
Section titled “Parameters:”- eventType:
string
- listener: (event:
Event
, options?:boolean
|AddEventListenerOptions
) =>any
Returns this
▸ on(eventType: string
,listener: (event: Event
, options?: boolean
| AddEventListenerOptions
) => any
): this
Parameters:
Section titled “Parameters:”- eventType:
string
- listener: (event:
Event
, options?:boolean
|AddEventListenerOptions
) =>any
Returns this
removeClass
Section titled “removeClass”▸ removeClass(className: string
,classNames: string
[]): this
Parameters:
Section titled “Parameters:”- className:
string
- classNames:
string
[]
Returns this
removeStyle
Section titled “removeStyle”▸ removeStyle(styleId: string
): this
Parameters:
Section titled “Parameters:”- styleId:
string
Returns this
setStyle
Section titled “setStyle”▸ setStyle(styleId: string
,styleValue: string
): this
Parameters:
Section titled “Parameters:”- styleId:
string
- styleValue:
string
Returns this
▸ show(): this
Returns this
▸ text(text: string
): this
Parameters:
Section titled “Parameters:”- text:
string
Returns this
▸ title(value: string
): this
Parameters:
Section titled “Parameters:”- value:
string
Returns this
▸ toDOM(): TElement
Returns TElement
toggleClass
Section titled “toggleClass”▸ toggleClass(className: string
,force?: boolean
): this
Parameters:
Section titled “Parameters:”- className:
string
- force:
boolean
, Default value =undefined
Returns this
visible
Section titled “visible”▸ visible(isVisible?: boolean
): this
Parameters:
Section titled “Parameters:”- isVisible:
boolean
, Default value =true
Returns this