Hi Dimby, 
your problem is very easy; you are creating a new element, a new '<li>', but it 
does not have an event attached. It's a beginner mistake.

You only need to change one line:

$('a.remove').live ('click', function() {
        var id= $(this).attr('id');
        $('li#'+id).fadeOut('fast', function(){ $('li #'+id).remove(); });
        i--;    
});

Now, when a new element is added, the event 'click' is attached to it and works 
fine. 

Bye.





> Date: Fri, 27 Feb 2009 06:31:29 -0800
> Subject: [jQuery] Remove doenst work on dynamically created li
> From: pauldul...@gmail.com
> To: jquery-en@googlegroups.com
> 
> 
> Hi,
> 
> I'm new, so to all of you HELLO Smile.
> Btw, im Dutch so maybe my English isnt that good.
> I love Jquery but i've got some starting problems.
> 
> Live demo:
> http://pauldulong.nl/jquery/dgm.php#
> 
> When I click on the X the tab disappears, perfect, as it should be.
> But when I create a new tab and try to remove that one it doesn't do
> anything.
> 
> What im I doing wrong?
> 
> Dimby - Paul du long

_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx

Reply via email to