javascript - remove icon not working in anchor tag -


i want remove added list using remove icon in anchor tag, removing , again opening list

    $('.list').on("click", ".remove", function () {            $(this).parent().remove();        });
<ul class="list">  <li><a href="#">list[i]<i class="fa fa-remove remove"></i></a></li>  </ul>

you removing a , use closest remove list item

  $('.list').on("click", ".remove", function () {       $(this).closest('li').remove();   }); 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -