simple jQuery - I can't figure out why this isn't working
<p>I am trying to do 2 things:
1: append a div to the body
2: make all clicks to links class 'editlink' make a popup and not go to their href</p>

<p>Doing just #2 is fine:</p>

<pre><code>$(document).ready(function(){
//  $(body).append("&lt;div&gt;Hello world&lt;/div&gt;");
  $("a.editlink").click(function(event){
    alert("Javascript-endabled users should see this");
    event.preventDefault();
  });
});
</code></pre>

<p>but if i uncomment the part 1 thing such:</p>

<pre><code>$(document).ready(function(){
  $(body).append("&lt;div&gt;Hello world&lt;/div&gt;");
  $("a.editlink").click(function(event){
    alert("Javascript-endabled users should see this");
    event.preventDefault();
  });
});
</code></pre>

<p>The div appears as expected but clicking editlink links no longer gives me a popup and navigates to the link's href.</p>

<p>what's going on?</p>
