On click of a button i need to remove a particular ul tag
This is my fiddle
http://jsfiddle.net/tdzfhzjy/54/
This is my code
<div role="main" class="ui-content oms-content">
<div class="myactivelabelsWrap" id="result">
<div data-role="collapsible" data-inset="false">
<h3>Heading 1<a class="icon-pencil-1 labelEditIcon" data_attr="123" >Edit</a></h3>
<ul data-role="listview" labellistulid="48" class="labellistUL ui-listview">
<li class="labellist ui-li-static ui-body-inherit ui-first-child ui-last-child">
<div class="leftlable">
<p class="minOrder">Min. Order Rs. 25/- Delivery Charges 21.11</p>
</div>
<div class="rightlable"> <a href="#" class="ui-link removerestaurant" data_vendor_id="5000821693" data_loc_name="Location1" data_ven_availability_id="46">Remove</a>
</div>
</li>
</ul>
<ul data-role="listview" labellistulid="47" class="labellistUL ui-listview">
<li class="labellist ui-li-static ui-body-inherit ui-first-child ui-last-child">
<div class="leftlable">
<p class="minOrder">Min. Order Rs. 25/- Delivery Charges 21.11</p>
</div>
<div class="rightlable"> <a href="#" class="ui-link removerestaurant" data_vendor_id="5000821693" data_loc_name="Location1" data_ven_availability_id="46">Remove</a>
</div>
</li>
</ul>
</div>
</div>
$(document).on('click', '.removerestaurant', function (event) {
var labellist_id = $(this).closest('.labellistUL').attr('labellistULid');
deltethislabel(labellist_id);
});
function deltethislabel(labellist_id) {
// do an ajax call if its success then remove it
$("#result").find("#" + labellist_id + " .labellistUL").remove();
}
Could you please let me know how to do this ??