I have 3 example sentence here wherein names are dynamically generated.

Is it possible to get the place of this names, like getting that it is after the word "**I'm**" and before **,**

```
<p id="demo">Hi, I'm Johnny Bravo, how can i help you?</p>

```

or

```
<p id="demo">Hi, I'm Martir de Kuts, how can i help you?</p>

```

or

```
<p id="demo">Hi, I'm Jayson Dee, how can i help you?</p>

```

After getting the place of the name on the sentence. What I am going to do next is to generate a random name on it but i have a working code on it so i only need to determine is to get the place of the name based on my example.

\*\*\*\*\*\* **UPDATE to my POST** \*\*\*\*\*\*

This is what I am trying to achieve, now its working and thanks for helping me.

```js
var target = document.getElementById('demo');
var text = target.textContent;
var ArrayName = ['Vincent', 'Marie', 'Paul', 'Virginie'];
var randomIndex = Math.floor(Math.random() * ArrayName.length); 
var randomElement = ArrayName[randomIndex];
var split1 = text.split(',');
var split2 = split1[1].split("I'm ")
split2[1] = randomElement;
split1[1] = split2.join("I'm ");
target.textContent = split1.join(',');
```

```html
<p id="demo">Hi, I'm Johnny Bravo, how can i help you?</p>
```