Yuv*_*rmi 3 jquery jquery-selectors
我有一个div用id article_50.如果我要选择.title里面的元素article_50,我可以做以下事情:
$("#article_50 .title").
现在说我想选择相同的标题,但在点击事件中:
$("#article_50").click(function(){
$(this).children(".title").hide();
});
Run Code Online (Sandbox Code Playgroud)
现在我不得不调用该children方法来选择该.title元素.我可以在同一选择器中选择它而无需调用children吗?
像这样的东西:
$("this .title").hide();
谢谢!