extra-dom
Version:
Utilities for DOM
11 lines • 365 B
JavaScript
export function removeAttributes(node, predicate) {
if (node instanceof Element) {
const attributeNames = Array.from(node.attributes).map(x => x.name);
for (const name of attributeNames) {
if (predicate(name)) {
node.removeAttribute(name);
}
}
}
}
//# sourceMappingURL=remove-attributes.js.map