So I have this piece of code:
var thisValue = $("input[id*=ID222]").val();
thisValue = thisValue.replace(',','');
Basically I want to remove all commas in this input element for taking it up for further processing. The above code works when there is only one comma in the field, but doesn’t work for multiple commas. Is there another way? I tried replaceAll, and it didn’t work.
You have to do a global replace using a regular expression. You can’t do this by passing a string to
replace: