title: select sub-children of div of specific type
body: <p>I want to select all the "input"-children of the "div"-children of my "mainDiv". I tried it with 'div input:first-child' as you can see below and as I found it on <a href="http://api.jquery.com/first-child-selector/" rel="nofollow">http://api.jquery.com/first-child-selector/</a>. But it doesn't work. If I use only 'div' as filter it works fine. So what is my mistake? Or how to get to all the "input"-children in an easy way?</p>
  
  <pre><code>        var data = ['name1', 'name2'];
          var mainDiv = $('&lt;div&gt;');
          for (var i = 0; i &lt; data.length; i++)
          {
              var div = $('&lt;div&gt;').appendTo(mainDiv);
              $('&lt;input type="checkbox"&gt;').appendTo(div);
              div.append(' ' + data[i]);
          }
          mainDiv.children('div input:first-child').each(
              function()
              {
                  var child = $(this);
                  alert('xx');
              });
  </code></pre>