How to turn a returned object into a string?
<p>I'm using an input that takes a number that a user enters and converts it to a dollar amount when the blur event fires.</p>

<p>The issue I am having is that the browser seems to keep previously submitted values intact with their dollar signs. So if the user selects a previously entered value of '$25000' from the drop down list, when the blur event fires again it adds in the '$' so I get '$$25000'</p>

<p>In order to stop this, i've made an adjustment to the string value if it contains 2 '$'s on blur:</p>

<p>HTML:</p>

<pre><code>&lt;input type="text" value="$5,000" id="dollar-amount-goal" /&gt;
</code></pre>

<p>Javascript:</p>

<pre><code>var valueOnBlur = $('#dollar-amount-goal').val();

if(valueOnBlur.charAt(1) === '$'){
    valueOnBlur = $('#dollar-amount-goal').val(valueOnBlur.substr(1));
}

console.log(typeof( valueOnBlur ));
</code></pre>

<p>The result of the typeof statement above when the string checking is run is 'object'. any time after it comes out as 'string' (which is what I want).</p>

<p>My question: How do I make the <code>"valueOnBlur = $('#dollar-amount-goal').val(valueOnBlur.substr(1));"</code> statement return a string when it's run?</p>

<p>Thanks</p>
