在 jquery 中,如何使用 of 引用元素的父$(this)级?class'abc'
65152 次
2 回答
43
像这样:
$(this).parents('.abc');
或者
$(this).parent('.abc');
或者
$(this).closest('.abc');
.parent()和.parents()相似,.parent()只是在 DOM 树中只向上移动一层。
于 2012-08-13T03:30:53.977 回答
1
<script>$(this).parent(".abc")</script>
于 2012-08-13T03:33:34.560 回答