Q:

jQuery | String replace does not work

I have the following script:
var id = $(this).attr('id');
var ui_id = id.replace("delete", "hidden");
var am_id = id.replace("delete", "internal");

If I do
console.log(id);

I get the following value:
widget-zcircle-2-link_image-remove

But the values of ui_id and am_id are not changing. 
The following code :
console.log(ui_id);
console.log(am_id);

print out in my console the following result:
widget-zcircle-2-link_image-remove
widget-zcircle-2-link_image-remove

instead of
widget-zcircle-2-link_image-hidden
widget-zcircle-2-link_image-internal

Is something wrong in my code that I cannot see ? 
Kind regards
Merianos Nikos

A:

Replace delete from remove in your replace function... just like
var ui_id = id.replace("remove", "hidden");

A:

Your input contains "remove" but your code is looking for "delete".