jQuery does not execute handler bound to elements that are dynamically created
<p>I am using Jquery to dynamically load the pages of my website. Basically hiding and showing divs depending on which main menu option you click.</p>

<p>The problem comes with the sub menu that is on each page; the menu changes when the pages change. I empty the <code>&lt;ul&gt;</code> and append new <code>&lt;li&gt;</code>s with each page change.</p>

<p>I have jquery hover and click functions that go with the sub menu <code>&lt;li&gt;</code>, they only work if the page is refreshed. The functions seem to stop working because I delete the <code>&lt;li&gt;</code> and then add new ones.</p>

<p>I don't understand why the functions don't just go to the new <code>&lt;li&gt;</code>.</p>

<p>Why is this?</p>
