mirror of
https://github.com/dzeiocom/libs.git
synced 2025-04-22 19:02:14 +00:00
parent
679291d7a8
commit
ba39a4eef8
@ -68,7 +68,7 @@ export default class DOMElement<T extends HTMLElement = HTMLElement> {
|
||||
public text(): string
|
||||
public text(val: string): this
|
||||
public text(val?: string) {
|
||||
if (val) {
|
||||
if (typeof val !== 'undefined') {
|
||||
this.item.innerText = val
|
||||
return this
|
||||
}
|
||||
@ -78,11 +78,11 @@ export default class DOMElement<T extends HTMLElement = HTMLElement> {
|
||||
public html(): string
|
||||
public html(val: string): this
|
||||
public html(val?: string) {
|
||||
if (val) {
|
||||
if (typeof val !== 'undefined') {
|
||||
this.item.innerHTML = val
|
||||
return this
|
||||
}
|
||||
return this.item.innerText
|
||||
return this.item.innerHTML
|
||||
}
|
||||
|
||||
public addClass(...classes: Array<string>) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user