Remove clicked element, its parent and parent's previous element
<p>I'm trying to remove all elements below after clicking on the <code>p</code> element. Could you give me any pointers where am I going wrong?</p>

<pre><code>&lt;h2&gt;Heading&lt;/h2&gt;
&lt;a href="#"&gt;
    &lt;p&gt;Click me to delete everything&lt;/p&gt;
&lt;/a&gt;

$('p').click(function() {
    $(this).remove().parent().remove().prev().remove();
});
</code></pre>

<p>Here is a <a href="http://jsfiddle.net/BcAa9/1/" rel="nofollow">jsfiddle</a>.</p>
