chat-aww / src /lib /utils /deepestChild.ts
coyotte508's picture
coyotte508 HF staff
✨ Remove endoftext (#70)
0abf663 unverified
raw
history blame
167 Bytes
export function deepestChild(el: HTMLElement) {
let newEl = el;
while (newEl.hasChildNodes()) {
newEl = newEl.lastElementChild as HTMLElement;
}
return newEl;
}