title: How to use jQuery's trim() function
body: <p>As discussed in many questions on stack - IE 8 wont accept <code>.trim()</code>, but the jQuery framework takes care of that. </p>
  
  <p>I don't know how to translate my function to use that version of trim (I thought I was already using jQuery), could someone advise? Here is my code:</p>
  
  <pre><code>$('input').val(function(index, val){
      return val.replace('Please Select', '').trim();
  });
  </code></pre>
  
  <p>This is designed to replace the string with nothing.</p>
  
  <p>I've tried:</p>
  
  <pre><code>$('input').val(function(index, val){
      return val.replace('Please Select', '')$.trim();
  });
  </code></pre>
  
  <p>but that was no good.</p>