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

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

c# - Abstract method in public abstract class implementing an internal interface doesn't compile? -

authentication - Mongodb revoke acccess to connect test database -