click wont work when placed with jquery  .html() or .replace()
<p>Hi im trying to replace a link if i click this other link. but i cant get click to work when i add the link with jquery <code>replace()</code> or <code>html();</code>. what im i doing wrong?</p>

<p>this is the code i try to use</p>

<pre><code>$(document).ready(function() {
        var countTotal = $('#myTable tr').length;
        $("#hideTotalCount").val(countTotal);

        $('#clickMeAll').click(function() {
            var totalCount = $("#hideTotalCount").val() - 1;
            $('#myTable').paginateTable({ rowsPerPage: totalCount, pager: '.pageNumbersOnly', maxPageNumbers: 4 });
            $('#placeLink').replaceWith("&lt;a href='#' id='clickMeRegular'&gt;Back to regular&lt;/a&gt;");
        });

        $('#clickMeRegular').click(function() {
            var totalCount = $("#original").val();
            $('#myTable').paginateTable({ rowsPerPage: totalCount, pager: '.pageNumbersOnly', maxPageNumbers: 4 });
            $('#placeLink').replaceWith("&lt;a href='#' id='clickMeAll'&gt;ViewAll&lt;/a&gt;");
        });

        $('#myTable').paginateTable({ rowsPerPage: 5, pager: '.pageNumbersOnly', maxPageNumbers: 4 });
        $('#placeLink').html("&lt;a href='#' id='clickMeAll'&gt;ViewAll&lt;/a&gt;");
    });
</code></pre>

<p>and <code>#placeLink</code> is just a regular <code>&lt;span&gt;</code></p>

<p>maybe somebody know something that can push me in the right direction? thanks</p>
