进阶题目,简单问题:
我如何在 jQuery 中执行以下操作(隐藏除 $(this)
之外的所有内容)?
$("table tr").click(function() {
$("table tr:not(" + $(this) + ")").hide();
// $(this) is only to illustrate my problem
$("table tr").show();
});
最佳答案
$(this).siblings().hide();
关于jquery - 通过 :not in jQuery selector 隐藏除 $(this) 之外的所有内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1328314/