jQuery code .val(); not working in FF
<p>I have this code</p>

<pre><code>function calculateTotal() {
    var total = 0;      
    $(".quantity").each(function() 
                                 {
                                     if (!isNaN(this.value) &amp;&amp; this.value.length != 0) 
                                     {             
                                     total += parseFloat(this.value);         
                                     }     
                                     });      
    $("#total_quantity").val(total); 
}

 &lt;input onchange="calculateTotal();"  name="sol1" type="text" class="result_form_textbox_small quantity" id="sol1" /&gt;

 &lt;input name="total_quantity" type="text" class="result_form_textbox_small" id="total_quantity" /&gt;
</code></pre>

<p>This code is working in IE very good but it's not working in FF.</p>

<p>What is the proplem?</p>

<p>Thanks in advance.</p>

<p>EDIT :</p>

<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;&lt;script type="text/javascript" src="javascripts/jquery-1.4.2.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="javascripts/jquery.mousewheel.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="javascripts/jquery.jscrollpane.min.js"&gt;&lt;/script&gt;
&lt;script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;link href="stylesheets/public.css" rel="stylesheet" type="text/css" /&gt;
 &lt;script type="text/jscript"&gt;
function calculateTotal() {
    var total = 0;      
    $(".quantity").each(function() 
                                 {
                                     if (!isNaN(this.value) &amp;&amp; this.value.length != 0) 
                                     {             
                                     total += parseFloat(this.value);         
                                     }     
                                     });      
    $("#total_quantity").val(total); 
} 
&lt;/script&gt;
&lt;/head&gt;
</code></pre>
