jQuery each() doesn't iterate on all elements
<p>I have stared too long on this apparently not working little piece of code. Why doesn't select box rel attribute get alerted?</p>

<p>HTML:</p>

<pre><code>&lt;select rel="prop216" name="prop[]"&gt;
  &lt;option value=""&gt;- none&lt;/option&gt;
  &lt;option value="12"&gt;Opt 1&lt;/option&gt;
  &lt;option value="13"&gt;Opt 2&lt;/option&gt;
&lt;/select&gt;
&lt;select rel="prop217" name="prop[]"&gt;
  &lt;option value=""&gt;- none&lt;/option&gt;
  &lt;option value="12"&gt;Opt 1&lt;/option&gt;
  &lt;option value="13"&gt;Opt 2&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>jQuery:</p>

<pre><code>$("select").change(function()
{
 var i = 0;
 var alteredSelects = [];
 $("select").each(function()
 {
    if ( $(this).val() !== "" )
    {
        alteredSelects[i][0] = $(this).attr('rel');
        alteredSelects[i][1] = $(this).val();
        alert ($(this).attr('rel'));
        i++;

    }
 });
});
</code></pre>

<p>See also my jSfiddle: <a href="http://jsfiddle.net/ft6Bd/1/" rel="nofollow">http://jsfiddle.net/ft6Bd/1/</a> </p>

<p>I get an error in Firefox </p>

<blockquote>
  <p>TypeError: can't convert undefined to object </p>
</blockquote>

<p>on the line <code>alteredSelects[i][0] = $(this).attr('rel');</code></p>

<p>But can't seem to realize why.</p>
