This is from stackoverflow and I am re-posting it here on my blog for record purposes. There is so much useful information there that in the days to come I will probably doing a bunch of re-posts from stackoverflow.com
//For example: $(this).children('.foo'); //gives the same result as: $(this).find('.foo'); |
The answer is:
Children only looks at the immediate children of the node, while find traverses the entire DOM below the node, so children will be faster. Which to use depends on whether you only want to consider the immediate descendants or all nodes below this one in the DOM.
Thanks to bartclaeys and tvanfosson from stackoverflow…
thanks for putting light on this fact..i was blindly using either of these.