开发者

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').

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜