8 lines
238 B
TypeScript
Raw Normal View History

2019-11-18 02:04:13 +00:00
export default function* findAllInside(className: string, root: HTMLElement): IterableIterator<HTMLElement> {
const elements = root.getElementsByClassName(className)
for(const element of elements) {
yield element as HTMLElement
}
}