Would it be possible to change a string containing this line of HTML:
'<div _ngcontent-isd-c78="" pdroppable="formElements" class="panel" ng-reflect-scope="formElements" id="divPanelId" style="color: red">DivContent</div>'
To this:
'<div id="divPanelId" style="color: red">DivContent</div>'
I want to remove _ngcontent-??
, pdroppable
, class
and ng-reflect-scope
.
Is it possible using JavaScript with Regex?
Note: _ngcontent-isd-c78
is changed randomly. For example, _ngcontent-sfw-c53
, _ngcontent-isw-c21
. So _ngcontent-????
where ????
is a random value