title: Access ID of unknown child DIV with javascript / jquery
body: <p>I am trying to access the id of an unknown div using its parent id. A simplified version of my html is something like:</p>
  
  <pre><code>&lt;div id="firstId"&gt;
     &lt;div id="secondId"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Just to be clear, I don't know the id of the child div. Then, I am trying to use the DOM to access it with:</p>
  
  <pre><code>var idd = $(".firstId").children().attr("id");
  alert(idd);
  </code></pre>
  
  <p>But I get an <code>undefined</code> alert (<a href="https://jsfiddle.net/vabm/otpmcf1o/1/" rel="nofollow">fiddle</a>). Not sure what might be the problem.</p>