title: Remove / (forward slash) from date string in Jquery
body: <p>I am trying to remove a forward slash from a date string.</p>
  
  <p>The date is currently in the format dd/mm/yyyy but i need to remove / and replace with -, so its dd-mm-yyyy</p>
  
  <p>I've tried lots of things, along these lines:</p>
  
  <pre><code>var from = $('#from_date').text().replace(/\//g, '-');
  
  var from_pre = $('#from_date').val();
  var from = from_pre.text().replace(/\//g, '-');
  </code></pre>
  
  <p>Where am i going wrong?</p>