我的问题很简单。我想在 jquery 中做的是这样的:
$(this > ".otherDiv").show();
但是它不起作用,我不知道为什么。我也尝试过:
$(this).$(".otherDiv").show();
$(this + ".otherDiv").show();
$(this ".otherDiv").show();
$(this.".otherDiv").show();
当我用其他东西替换它时它就起作用了。我测试过,这确实是我想要的父 div。我做错了什么吗?
谢谢!
最佳答案
这是正确的形式:
$(this).children('.otherDiv').show();
关于jquery - jquery中的选择器问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5012596/