You asked why, so here is why:
In the context of the jQuery event handler, this refers to the reference to the DOM element that jQuery stores for the element for which you are currently handling events. Since the .remove() function you are going to use is a jQuery function and not a built-in DOM browser function, it does not work properly.
However, if you exchange the DOM link inside $() or jQuery() , so it becomes $(this) instead of this , the $ or jQuery function takes the DOM link as a parameter and returns a jQuery link, which can then contain jQuery member functions.
You can always pass your DOM links to jQuery and put jQuery links back
eg.
var test = document.getElementById('test'); $(test).remove();
http://jsfiddle.net/2h45Y/
source share