Say I have the following code to add a clickable image after a set of elements. The click handler fires every time the image is clicked which is not what I want. I guess hiding the image using .hide() in the click handler is one approach but I can't figure out how to refer to the img element in the click handler.
Help? Thanks
$(...)
.after($('<img src="..."/>')
.css("cursor","pointer")
.attr("title","Click here for ...")
.click(function(){ ... }