Reputation: 5953
I'm trying to remove some li lines of html.
This is the html:
This is the jquery I'm trying to use:
$("li").remove(":contains('undefined')");
Thanks for the help!
Upvotes: 0
Views: 211
Reputation: 318182
I'd do it this way :
$('li').filter(function() {
return $(this).find('span').text().indexOf('undefined') != -1;
}).remove();
Upvotes: 1
Reputation:
Try:
$("li span:contains('undefined')").remove();
It works in my head :)
EDIT This will remove the LI:
$("li span:contains('undefined')").parent().parent().remove();
Upvotes: 0