How to remove $ from javascript variable?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4846978/remove-characters-from-a-string">Remove characters from a string</a>  </p>
</blockquote>



<p>I have a variable <code>p</code> which I would like to remove the <code>$</code> from. This variable will be a number such as <code>$10.56</code>. How can I do this? I thought it could be done using <code>.replace('$','')</code> but i'm not quite sure how to implement this. </p>

<p>Here is my javascript code:</p>

<pre><code>function myFunction() {
  var p = parseFloat(document.getElementById('p_input').value);
  var q = parseFloat(document.getElementById('q_input').value);
  if (!q){
  document.getElementById('t').value = '';
  }
  else {
  var t = q * p;
  document.getElementById('t_output').value = t;
  }
}
</code></pre>
