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 -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -