Adding get() to line causes "is not a function" error
<p>This is the start of an inventory system I am working on. Basically it takes an array with items and quantities in a compressed form and outputs the items into an item div.</p>

<p>Running the below produces no error:</p>

<pre><code>$('.item_amount').html(collection[itemName].amo);
</code></pre>

<p>Adding the get() method after the selector like so:</p>

<pre><code>$('.item_amount').get(i).html(collection[itemName].amo);
</code></pre>

<p>produces "$(".item_amount").get(i).html is not a function".</p>

<p>This is what the line is altering:</p>

<pre><code>        &lt;div class="item"&gt;
        &lt;img src="" class="item_image"/&gt;
        &lt;div class="item_amount"&gt;&lt;/div&gt;
    &lt;/div&gt;
</code></pre>

<p>The line that is causing the error is located in a for loop that loops through all the keys in an array. Then outputs the item quantity from the array in the item_amount div based on the index stored in the variable "i". The for loop also creates an object for each item in the array and puts in the a collection object.</p>

<p>Full code below:</p>

<pre><code>    &lt;body&gt;
    &lt;div class="item"&gt;
        &lt;img src="" class="item_image"/&gt;
        &lt;div class="item_amount"&gt;&lt;/div&gt;
    &lt;/div&gt;

    &lt;div class="item"&gt;
        &lt;img src="" class="item_image"/&gt;
        &lt;div class="item_amount"&gt;&lt;/div&gt;
    &lt;/div&gt;

    &lt;div class="item"&gt;
        &lt;img src="" class="item_image"/&gt;
        &lt;div class="item_amount"&gt;&lt;/div&gt;
    &lt;/div&gt;

&lt;script type="text/javascript"&gt;
    var collection = new Object(); 

    function makeItem(itemName, id, amo) {
        collection[itemName] = new item(id, amo); 
    }

    function item(id, amo) { 
        this.id = id;
        this.amo = amo;

    }


    var inventoryCom = "368.9,366.15,384.32"; //compressed inventory
    var inventoryArr = inventoryCom.split(','); 

    for(var i=0; i &lt; inventoryArr.length; i++) {

        var itemName = 'item' + (i + 1); //unique name for each item
        var itemArr = inventoryArr[i].split('.'); 

        makeItem(itemName, itemArr[0], itemArr[1]); 


        $('.item_amount').get(i).html(collection[itemName].amo);
           }

&lt;/script&gt;

&lt;/body&gt;
</code></pre>
