jQuery: shortening $(this).find('.something').xxx into $(this, '.something').xxx
Can I, in jQuery, combine $(this) with another element selector?开发者_C百科
It's:
$('.something', this)
They're equivalent, since this functionality (selector context) is actually implemented using find
. There's a similar example in the docs:
$('span', this) is equivalent to $(this).find('span').
精彩评论