Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
你可以做
$("li").has("a[id^='ids']").remove();
或者
$("a[id^='ids']").closest('li').remove();
要删除li和 文本,您可能应该在删除之前向上遍历一个级别:
li
$("a[id^='ids']").parent().remove();