UNPKG

monphind-ui

Version:

A reactive component library built on top of the Web Components API

14 lines (13 loc) 372 B
export const select = (parent, selector, attribute) => { const element = parent.querySelectorAll(selector); const rst = new Array(); outer: for (const value of element) { for (const i in attribute) { if (value?.[i] != attribute[i]) { continue outer; } } rst.push(value); } return rst; };