2012-02-14 2 views

Répondre

4
$('ol li.menu-item').click(function() { 
    $(this).find('span.name').clone().appendTo('#check-items'); 
}); 
1

Vous pouvez fournir this comme contexte au sélecteur.

$('ol li.menu-item').click(function() { 
    $('span.name', this).clone().appendTo('#check-items'); 
}); 
0

Essayez ceci:

$('ol li.menu-item').click(function() { 
    $('#check-items').append($('span.name', this).html()); 
}); 
Questions connexes