我有以下代码,
$('.button').click(function(){
var inputItem = $('.listItem').val();
$('.thelist').append('<li class="item">'+inputItem+'</li><span class="delete">delete</span>');
});
//TRYING TO REMOVE THE ITEM
$(document).on('click','.delete',function(){
$(this).remove(function(){
$('.item').remove();
});
});
我对 jQuery 还是很陌生,谁能指出我正确的方向。谢谢