.replace() not working inside a jQuery function
<p>I don't understand why replace() function doesn't work into my jQuery function:</p>

<pre><code>jQuery(document).ready(function($){
   var amount_min =  &lt;?php if($_GET['amount_min']) echo $_GET['amount_min']; else echo '0'; ?&gt;;
   var amount_min = amount_min.replace(/[^\d]/g, "");
   $('input[name=amount]').val(amount_min);
});
</code></pre>

<p>Whatever input I give (for example "100ab" or "10.000") it doesn't replace it with "100" or "10000".
How to do?</p>
