7 lines
175 B
TypeScript
Raw Normal View History

2017-06-20 10:41:26 +00:00
export function* findAll(query: string) {
let elements = document.querySelectorAll(query)
for(let i = 0; i < elements.length; ++i) {
yield elements[i] as HTMLElement
}
}