Question: I need to remove a string ("DTE\_Field\_") from the id of elements in the dom.

```
<select id="DTE_Field_CD_PAIS" dependent-group="PAIS" dependent-group-level="1" class="form-control"></select>

var str=$(el).attr("id");
str.replace("DTE_Field_","");

```

Answer: 
You can split the string(`id`) and use `pop()` method to get the last element of the array

```
var str=$('#DTE_Field_CD_PAIS').attr("id");
alert(str.split("DTE_Field_").pop());

```

[**JSFIDDLE**](https://jsfiddle.net/vasi_32/g6Lu7ywr/1/)
```
$('[id^="DTE_FIELD_"]').each(function () {
   $(this).attr('id', $(this).attr('id').replace('DTE_FIELD_',''));
});

```