Laurent Goussard schrieb:
> Thanks for your answers !
>
> That's exactly what I was afraid to understand.
> I can't imagine I'm the only one who wanted to add jQuery events on
> html content loaded with jQuery. Am I ?
Please take a look at my second example again:

$("#trigger").click(function(){
        $("#content").append('<div class="test">click does not work</div>') // 
no ; here
        .find(".test").click(function(){
                alert("yeepee");
        });
        return false;
});

It searches for the formerly appended div inside #content, instead of 
looking everywhere. You can, by making the selector more specific, 
select only the div that was added latest (eg. ".test:last"), so it gets 
applied really only to the new div, not the ones that existed before.

-- 
Jörn Zaefferer

http://bassistance.de


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

Reply via email to