retrieve quantity from dynamic js menu
<pre><code>    function showNumber(selectId, divNumber) {
    //this takes value from select option and grabs div for displaying it
    var select = document.getElementById(selectId);
    var noItems = document.getElementById(divNumber);

//loop for creating 0-20 drop down
    for (var i = 0; i &lt;= 20; i++) {
    var option = document.createElement('option');
    option.innerHTML = i;
    option.value = i;

    select.appendChild(option);
    }

    //onchange shows in a div how many items were selected
    select.onchange = function () {
    var noZero = select.value;
    if (noZero &gt; 0) {
    noItems.innerHTML = noZero;
    } else noItems.innerHTML = " ";
    };
    }

    //function takes parameters of the previous one and displays number of items of a particular product in a div
    function showDivs(){
    showNumber('item1', 'div1');
    showNumber('item2', 'div2');
    showNumber('item3', 'div3');
    showNumber('item4', 'div4');
    }
</code></pre>

<p>My problem is that I would like to add quantities of all the products (item1, item2 etc.) in order to calculate the total number of them. I don't seem to be getting anywhere with that, any help greatly appreciated!...</p>
