Children of an array element
<p>I'm a beginner in jQuery and here's what I'm trying to do:</p>

<ul>
<li>Find all elements (let's call them boxes to avoid confusion later) with class "chosen" and assign a number to each.</li>
<li>In each of those boxes, find all input elements in them.</li>
<li>To each input element's name add it's box number. For instance, if in 3rd box there was a text input element called "login", it should be renamed to "login3".</li>
</ul>

<p>Here's the code I made so far:</p>

<pre><code>boxes = $('.chosen');
for(a = 0; a &lt; boxes.length; a++) {
    inputsinboxes = boxes[a].children('input');
    for(b = 0; b &lt; inputsinboxes.length; b++) {         
        inputsinboxes[b].name = inputsinboxes[b].name + (a+1);
    }
}
</code></pre>

<p>I'm stuck though since it keeps telling me <code>boxes[a].children</code> is not a function.</p>

<p>What am I doing wrong?</p>
