karthik karthik - 1 month ago 11
Javascript Question

String Replace in jquery or javascript

I want to replace the word "residue1" to "calcule" in jquery or javascript but the actual word was "residue11" .

I user this function but it's not effective

var calculeId = residueId.replace('residue1', 'calcule');

Answer

It will be like

var residueId = "residue11";
var calculeId = residueId.replace('residue1', 'calcule');
alert(calculeId);