Novice Javascript query about bad input
<p>I am making a simple tip calculator to help myself learn Javascript. The problem I can't solve is how to compensate for "bad input".</p>

<p>In the code below if the user prefaces the numeric input amount with a dollar sign <code>$</code>, the result is <code>NAN</code>.  </p>

<pre><code>function tipAmount(){
var dinner=prompt("How much was dinner?");
result = dinner*.10;

alert("Your tip is " +"$"+result );

}
</code></pre>

<p>How do I fix that.</p>
