I am trying to find a way to replace part of a string in an input value, but could not get it to work.
the input field is as follows:
<input type="text" value="20,54,26,99" name="ids" />
I tried:
$('input[name=ids]').val().replace("54,","");
and
var replit = $('input[name=ids]').val(); replit.replace("54,",""); $('input[name=ids]').val(replit);
but didnβt work?
jquery replace
Wonderbugger
source share