jQuery选择器问题

时间:2011-08-20 02:13:03

标签: jquery performance jquery-selectors

做法有何不同:

$(this).find('.action')

$('.action', this)

表现?如果是这样哪一个更好,为什么?

其他什么?

1 个答案:

答案 0 :(得分:5)

每个jQuery文档(http://api.jquery.com/jQuery/)没有区别:

  

在内部,选择器上下文是使用.find()方法实现的,所以$(' span',this)相当于$(this).find(' span')