tags:

views:

70

answers:

2

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

+6  A: 

Find is recursive, where children looks only 1 level deep in the DOM. Check out this: http://blog.ekini.net/2009/03/16/jquery-children-vs-find-which-is-faster/

Note: that is actually references a Stackoverflow post.

Either way, that should help answer your question. If you need to search more than one level use Find, if not use children as it is faster.

Dustin Laine
+3  A: 

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/

Jonathan Sampson