Getting the ID of the most recent DIV with Jquery
<p>I have a webpage that dynamically prepends new divs about once per minute.</p>

<p>Here is what the HTML code basically looks like:</p>

<pre><code>&lt;div id="container"&gt;&lt;/div&gt;

&lt;div id="freshcontent"&gt;
 &lt;div id="501"&gt;Stuff 2:18pm&lt;/div&gt;
 &lt;div id="500"&gt;Stuff 2:12pm&lt;/div&gt;
 &lt;div id="499"&gt;Stuff 2:09pm&lt;/div&gt;
 &lt;div id="498"&gt;Stuff 2:05pm&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>I want to retrieve the id of the most recent div that is inside the "freshcontent" div, which would be "501" in the example above.</p>

<p>Then I want to take the id number and insert it into some Jquery code, which I have here:</p>

<pre><code>&lt;script type="text/javascript"&gt;
 $(document).ready(function() {
  $.ajaxSetup({ cache: false });
   setInterval(function() {
   $("#container").load("/webpage/?id="+THE_ID_NUMBER_GOES_HERE);
  }, 10000);
 });
&lt;/script&gt;
</code></pre>

<p>So I have 2 questions:</p>

<ol>
<li>How do I get the id of the most recent div (which is constantly changing)?</li>
<li>How do I insert it into my Jquery code?</li>
</ol>

<p>I'm new to Javascript/Jquery, so I'm not sure how to do this. I've tried using .first() and .closest(), but I can't get it to work.</p>
