jQuery set call back on child elements
<p>I am trying to attach an onChange callback to all the input elements under the div <code>#dim</code>. It selects all 3 input elements, but returns an exception: </p>

<pre><code>Uncaught TypeError: Object 0 has no method 'change'
</code></pre>

<p>It may be because <code>x</code> may not be a jQuery object. How would I make this work?</p>

<pre><code>function registercb() {
    var sel = $("div.dim &gt; input");
    for (x in sel) {
        x.change(function() {
            dosomething();
        });
    }
}
</code></pre>
