I want to append array values in their respective div's, I've the following array of values with their "THINGS" taht points to the respective div's named as `THING1`, `THING2` and so on

```
["THING1", "ABC", "123", "THING2", "DEF", "456", "GHI", "789", "JKL", "123", "THING3", "MNO", "123", "PQR", "546"]

```

I'm checking the id's as follow

```
if(this.getAttribute('id')=="ITEM"+i)
{
//exits
}

```

All I need is to append the values after the indicators (THING) in their respective div's (ITEM). 

**My Attempt:**
JS:

```
for (var i = 0; i <= myThings.length; i++) {
                var item;
                if (myThings[i] != null)
                   item = "ITEM1";
                else    if (myThings[i][i] != null)
                     item = "ITEM2";
                else       if (myThings[i][i] != null)
                    item= "ITEM3";
                else           if (myThings[i][i] != null)
                     item = "ITEM4";

                    if (myThings[i] == item)
                    {
var e = myThings[i];
                       $('#'+j).after(e); 
                    }
                };

```

HTML:

```
<div id="ITEM1"></div>
<div id="ITEM2"></div>
<div id="ITEM3"></div>
<div id="ITEM4"></div>

```