# Simple yet puzzling jquery problem

**URL:** <https://forum.kirupa.com/t/simple-yet-puzzling-jquery-problem/273057>\
**Category:** Uncategorized\
**Created:** [October 10, 2008, 4:44pm UTC](https://forum.kirupa.com/t/simple-yet-puzzling-jquery-problem/273057 "2008-10-10T16:44:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qgeis](https://avatars.discourse-cdn.com/v4/letter/q/76d3ee/32.png) [@Qgeis](https://forum.kirupa.com/u/Qgeis)\
**Post date:** [October 10, 2008, 4:44pm UTC](https://forum.kirupa.com/t/simple-yet-puzzling-jquery-problem/273057/1 "2008-10-10T16:44:30Z")

</div>

```auto
<script type="text/javascript">
$(document).ready(function() {
    $(".foo").click(function(){
        var $el = $(this);
        $el.replaceWith('<a href="/url" rel="xyz" class="foo">Link</a>');
        return false;
    });
});
</script>
<a href="/url" rel="xyz" class="foo">Link</a>

```

I should be able to keep clicking forever right? But it seems that after replaceWidth() for the \<a\> element, though having class=“foo”, return false; isn’t working.

Any jquery experts here can give me a hand?
