$("#divbindProjectlist").append('<a href="#" class="list-group-item projectList" ><span class="project-name">' + json.ProjectName + '<input type="hidden" value="' + json.idPartnerProject + '" /></span><i class="pull-right close-p">x</i></a>');
<div id="divbindProjectlist" class="left-top-p"> <a class="list-group-item active left-menu-head">Projects List</a> <a href="#" class="list-group-item projectList"> <span class="project-name">ssssssss</span><i class="pull-right close-p">x</i> <input type="hidden" class="hidprojectId" value="0.37421775864182916"> </a> <a href="#" class="list-group-item projectList"> <span class="project-name">asdfasdf</span><i class="pull-right close-p">x</i> <input type="hidden" class="hidprojectId" value="0.6032844290071158"> </a> <a href="#" class="list-group-item projectList"> <span class="project-name">asdfasdf</span><i class="pull-right close-p">x</i> <input type="hidden" class="hidprojectId" value="0.28981124419382853"> </a> </div>
$(document).on("click", ".close-p", function () { $(this).parentsUntil(".list-group-item.projectList").remove(); });
$(document).on("click", ".close-p", function (evt) { evt.preventDefault(); $(this).closest(".list-group-item.projectList").remove(); });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)