8 lines
217 B
TypeScript
Raw Normal View History

2019-11-18 11:04:13 +09:00
export default function* findAll(className: string): IterableIterator<HTMLElement> {
2019-11-17 18:25:14 +09:00
const elements = document.getElementsByClassName(className)
2018-04-02 07:34:16 +02:00
2019-11-18 11:04:13 +09:00
for(const element of elements) {
yield element as HTMLElement
2018-04-02 16:07:52 +02:00
}
}