What is fastest children() or find() in jQuery?

前端 未结 6 2003
悲&欢浪女
悲&欢浪女 2020-11-22 13:43

To select a child node in jQuery one can use children() but also find().

For example:

$(this).children(\'.foo\');

gives the same result

6条回答
  •  -上瘾入骨i
    2020-11-22 14:42

    Here is a link that has a performance test you can run. find() is actually about 2 times faster than children().

    Chrome on OSX10.7.6

提交回复
热议问题