Here\'s the code:
const test = Array.from(document.getElementsByClassName(\'mat-form-field-infix\'));
test.forEach((element) => {
element.outerHTML =
You need a typecast:
Array.from(document.getElementsByClassName('mat-form-field-infix') as HTMLCollectionOf)
That's because getElementsByClassName only returns HTMLCollection, and Element does not have a styleproperty. The HTMLElement however does implement it via it's ElementCSSInlineStyle extended interface.
Note that this typecast is typesafe in the way that every Elementis either a HTMLElement or an SVGElement, and I hope that your SVG Elements don't have a class.