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
Doing just #2 is fine:
$(document).ready(function(){
// $(body).append("<div>Hello world</div>");
$("a.editlink").click(function(event){
alert("Javascript-endabled users should see this");
event.preventDefault();
});
});
but if i uncomment the part 1 thing such:
$(document).ready(function(){
$(body).append("<div>Hello world</div>");
$("a.editlink").click(function(event){
alert("Javascript-endabled users should see this");
event.preventDefault();
});
});
The div appears as expected but clicking editlink links no longer gives me a popup and navigates to the link's href.
what's going on?