JQuery difference between searching 'children' and 'find'?

后端 未结 3 883
Happy的楠姐
Happy的楠姐 2021-01-07 19:16

When is one preferred over the other when searching for nested Divs?

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-07 19:47

    The .find() and .children() methods are similar, except that the latter only travels a single level down the DOM tree.

    Source: http://api.jquery.com/children/

提交回复
热议问题