I want to add to existing text based on the input user provide,

below is what I am trying to reach

```
<html>
<p>Enter the IDs of devices seperated by comma</p>
<input id="devicesIDs"></input>

```

```
<script> 
            function ButtonClicked(devicesIDs): 
            var IDs = document.getElementById("devicesIDs").innerText;
            var inputArray = IDs.split(',');

            let obj = {
        "c8y_isDynamicGroup": {
        "invisible": true
    },
    "type": "c8y_DynamicGroup",
    "name": " SmartGroupSendMessageXXX",
    "hajjMessage": "messages typed in the widget",
    "c8y_DeviceQueryString": "$filter=((id eq '**{{entered ID1}}**') or (id eq '**entered ID2**')) or (id eq '**entered ID3**'))"
}
console.log(obj)
postData('......url....', obj)
    .then(data => {
        console.log(postData)
        console.log(data);
    }); 
            </script>

```

I need "**or (id eq 'entered ID3'))**" to be added to the original text **$filter=((id eq '{{entered ID1}}')** if there more than one Id entered, based on the number of IDs, and to have each ID in it