mirror of
https://github.com/dzeiocom/libs.git
synced 2025-07-05 13:39:17 +00:00
@ -68,7 +68,7 @@ export default class DOMElement<T extends HTMLElement = HTMLElement> {
|
|||||||
public text(): string
|
public text(): string
|
||||||
public text(val: string): this
|
public text(val: string): this
|
||||||
public text(val?: string) {
|
public text(val?: string) {
|
||||||
if (val) {
|
if (typeof val !== 'undefined') {
|
||||||
this.item.innerText = val
|
this.item.innerText = val
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
@ -78,11 +78,11 @@ export default class DOMElement<T extends HTMLElement = HTMLElement> {
|
|||||||
public html(): string
|
public html(): string
|
||||||
public html(val: string): this
|
public html(val: string): this
|
||||||
public html(val?: string) {
|
public html(val?: string) {
|
||||||
if (val) {
|
if (typeof val !== 'undefined') {
|
||||||
this.item.innerHTML = val
|
this.item.innerHTML = val
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
return this.item.innerText
|
return this.item.innerHTML
|
||||||
}
|
}
|
||||||
|
|
||||||
public addClass(...classes: Array<string>) {
|
public addClass(...classes: Array<string>) {
|
||||||
|
Reference in New Issue
Block a user