> $("div.tags").click(function() {
>     $(this).html("<a href=\"index.php\" class=\"resetme\">Test</a>"); });
>
> $("div.tags > a").click(function () {
>    alert("help");
>    return false;
> });
>
> the new link doesn't activate the .click() function and I
> don't know why! Basically jQuery is ignoring it.

A jQuery statement like $("div.tags > a").click(...) is saying, "bind a
click handler for all child links of div.tags that exist **right now**."
Later, if you replace the contents of the div, all the bound events for its
child elements are gone. You have to execute that statement again to rebind
the event handlers to the (new) elements that exist at that point in time.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to