我正在尝试删除一些 li html 行。
这是html:
这是我正在尝试使用的 jquery:
$("li").remove(":contains('undefined')");
谢谢您的帮助!
我正在尝试删除一些 li html 行。
这是html:
这是我正在尝试使用的 jquery:
$("li").remove(":contains('undefined')");
谢谢您的帮助!
你可以试试:
$("li:contains('undefined')").remove();
我会这样做:
$('li').filter(function() {
return $(this).find('span').text().indexOf('undefined') != -1;
}).remove();
尝试:
$("li span:contains('undefined')").remove();
它在我脑海中起作用:)
编辑这将删除 LI:
$("li span:contains('undefined')").parent().parent().remove();