我无法为我的生活找出正确的选择器语法来使其工作.
我有一个div元素.使用$(this),如何选择<TD>具有a class="stock"但仅在$(this)div元素中的?
使用find():
$(this).find('td.stock');
Run Code Online (Sandbox Code Playgroud)
或者,this作为上下文传递给$()方法:
$('td.stock', this);
Run Code Online (Sandbox Code Playgroud)
两者都做同样的事情.