title: How to replace part of an input value in jQuery?
body: <p>I've been trying to figure out a way to replace part of a string in an <em>input</em> value, but haven't been able to get it working.</p>
  
  <p>The <em>input field</em> looks like this:</p>
  
  <pre><code>&lt;input type="text" value="20,54,26,99" name="ids" /&gt;
  </code></pre>
  
  <p>I've tried:</p>
  
  <pre><code>$('input[name=ids]').val().replace("54,","");
  </code></pre>
  
  <p>and</p>
  
  <pre><code>var replit = $('input[name=ids]').val();
  replit.replace("54,","");
  $('input[name=ids]').val(replit);
  </code></pre>
  
  <p>but neither worked?</p>