How do i remove var icon element once i have appended it? the current method is not working.
i tried the way explained here but it didnt work.
JQUERY
$('#edit').toggle(function(){
    $('#edit').text('Close');
    var icon='<i class="icon-remove"></i>';
    $('.para').append(icon);
}, function(){
    $('#edit').text('Edit');
    var $icon = $(icon).not('i');
    $('.para').append($icon);
});
this doesnt work either
    $('#edit').toggle(function(){
    $('#edit').text('Close');
    var icon='<i class="icon-remove"></i>';
    $('.para').append(icon);
}, function(){
    $('#edit').text('Edit');
    var icon='.remove';
    $('.para').remove(icon);
});
HTML/PHP
foreach ($users_tags as $key => $list) {
echo '<span>'.$list['tag_name'].'<span class="para"></span> </span>. ';
}