I am using typescript to adjust a templated html built file. In my TS file I have the following code:
let body = document.querySelector("body");
// Looking at using this to remove all attributes of certain types/names
[...elem.attributes].forEach(attr => elem.removeAttribute(attr.name))
The body variable is the BodyElement from the DOM and pulls it in fine. I need to parse all elements to remove the attributes called:
click.delegate="doSomething();"
show.bind="toggle();"
and the class:
aurelia-hide
It would be great to forEach through this once in TS to get rid of it all quickly.