How to find all links in a div, add them to the DOM and give a count of the links
<p>I have a list of links inside a div.  I am trying to click a button outside of that div and have every link inside of the div printed on screen as well as the number of links on the page.  Not quite sure how to do it..</p>

<p>js</p>

<pre><code>$(function()
{
$('#button').click(function()
{
    $('#links a').each(function()
    {
        var count = $('#links a').length;
        $(this).appendTo('#results');
        $('span').text('there are ' + count 'links');
    });
});

});
</code></pre>

<p>html</p>

<pre><code>&lt;a href="#" id="button"&gt;button&lt;/a&gt;
  &lt;div id="links"&gt;
  &lt;a href="#"&gt;one&lt;/a&gt;
  &lt;a href="#"&gt;two&lt;/a&gt;
  &lt;a href="#"&gt;three&lt;/a&gt;



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