jquery - How do I remove the parent element? -
i'm brand new jquery , not sure if i'm referring correctly "parent" element. want remove 2 <li> tags completely. there way single id declaration?
<li class="remove"><a href="#">ds</a></li> <li class="remove"><a href="#">xfg</a></li>  <li><a href="#">ds</a></li>   <------this stays 1 below <li><a href="#">xfg</a></li> 
you can
$('.remove').remove(); // matches class="remove" gone completely. or click of it's <a>
$('#ulid li a').click(function(){    $(this).closest('.remove').remove();    return false; // prevent link jump page. }); welcome stackoverflow.com
 don't forget accept answer
Comments
Post a Comment