jQuery:使用 show() 显示父节点的一些节点

jQuery: show some nodes of the parent with show()

本文关键字:父节点 节点 显示 使用 show jQuery      更新时间:2023-09-26

In jQuery

var myblock = $("#mycaret");
//then myblock slighly modified by jQuery

使用修改后的 myblock,我想这样做:

排除 jQuery 为myblock内的所有表table th:first-child {display:none;}的这种 CSS 样式?

这几乎与

$("#mycaret table th:first-child").show();

但是我需要它来myblock变量。

谢谢。

您可以使用:

$('table th:first-child', myblock).show();

或:

myblock.find("table th:first-child").show();

你是说这个?

$(myblock).find("table th:first-child").show();