I am receiving a string which contains html element as response from which I am striping out particular values , I am able to apply it if the string contains single occurrence of that value , how can I do it for multiple occurrences
The html string which I would be receiving And using split I am able to get the value for a single occurrence below is the code
String containing html
"<div xmlns="http://www.w3.org/1999/xhtml" _ngcontent-c5=""
appdropzone="" appmovablearea="" class="dropzone" id="toget" ng-reflect-
ng-style="[object Object]" style="width: 100%; background-image:
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAAC6CAMAA
teXl6RkZGnp6dtbW2FhYkJggg==");
background-repeat: no-repeat; background-position: center center;
background-size: 100% 100%; border: 1px solid black; height: 340px;">
<!--bindings={
"ng-reflect-ng-for-of": ""
}-->
<div _ngcontent-c5="" appdroppable="" appmovable=""
class="box draggable movable ng-star-inserted" touch-action="none"
style="transform: translateX(183.2%) translateY(56%);"> abc
<span _ngcontent-c5="">X</span>
</div>
<div _ngcontent-c5="" appdroppable="" appmovable=""
class="box draggable movable ng-star-inserted" touch-action="none"
style="transform: translateX(183.2%) translateY(56%);"> def
<span _ngcontent-c5="">X</span>
</div>
<div _ngcontent-c5="" appdroppable="" appmovable=""
class="box draggable movable ng-star-inserted" touch-action="none"
style="transform: translateX(183.2%) translateY(56%);"> ghi
<span _ngcontent-c5="">X</span>
</div>
<div _ngcontent-c5="" appdroppable="" appmovable=""
class="box draggable movable ng-star-inserted" touch-action="none"
style="transform: translateX(183.2%) translateY(56%);"> jkl
<span _ngcontent-c5="">X</span>
</div>
</div>"
The code for splitting and getting the value for single occurence
this.droppeditem = data.split('touch-action="none" style=')[1]
.split('<span')[0];
console.log(this.droppeditem);
The value what I get
""transform: translateX(183.2%) translateY(56%);"> abc "
How can I get this transform and (abc or def or ghi or jkl) value out of each of the divs