Click event does not persist for new dynamically created elements
<p>I have some code that attaches to the click event of a class:</p>

<pre><code>$(".filter-link").click(function (e) {
    $("#filter").dialog("option", "position",
                    { my: "left top", at: "left bottom", of: e });
    $("#filter").dialog("open");
});
</code></pre>

<p>The element I use it on is dynamically recreated often:</p>

<pre><code>function addTopLinks() {
    $('#calendar .fc-view thead th.fc-resourceName')
        .removeClass('top-calendar-cell');
    $('#calendar .fc-view thead th.fc-resourceName')
        .addClass('top-calendar-cell');
    $('#calendar .fc-view thead th.fc-resourceName')
        .html('&lt;a class="filter-link" href="#"&gt;Filter Resources&lt;/a&gt;');
};
</code></pre>

<p>Is there any way I can get the click to persist or will I be forced to reassign the click every time I recreate the element?</p>

<p>Thanks</p>
