Let's say you have something like this: var clickHandler = function() { var link = $('<span></span>'); someElement.append(link); link.click (clickHandler); ??? } Code (markup): Is there a way to append the function the the link is in as an action of that link? I know that the example above is going to result in a recursive endless loop. I don't intend to use it like this. I just give this as an example.