Uncaught ReferenceError: Invalid left-hand side in assignment 'Cart' total calculation
<pre><code>function totalPrice()
        {
        var totalItems = document.getElementsByName("price").length;
        var total = 0;
        var rgx = /[^0-9]\x2e$/g;
        var price;
        var string_in = document.getElementsByName("price");

        for (var x=0; x&lt;totalItems-1; x++){

            price = new Number(rgx.exec(string_in[x].text));
            parseFloat(total) = parseFloat(total) + parseFloat(price); //This is where the error occurs
        }
        document.getElementById("total").innerHTML = ' $' + total;
        }
</code></pre>

<p>This is my function that the script executes, There are x number of items in my 'cart'. we must write this function in Javascript only. No php. The Named elements contain a price in the form of $123.45 (or more digits)</p>
