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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -