Here's the thing - a click event adds a bunch of elements on the page, and they all have the same id (is there something wrong here?).
I use a live function to assign click event to all of these elements:
$("#tag").live('click', function() {
console.log($("#tag").html());
});
When I click on any of them, only the value of first element gets logged.
How can I let the click event know on which of this elements I actually click? Thanks a lot!
Update: using classes and $(this) is the way to go. Problem solved. Thanks griegs and John!