.find()
is simply for searching for descendants of a jQuery object that represents a DOM element.
An example use case would be passing a jQuery object that represents a form element into a form parsing function, and then using .find()
to grab different values from the form's child inputs.
Instead of converting the form into a jQuery object every time you want to grab an element, it's cheaper to assign the jQuery form object to a variable, and then use .find()
to grab the inputs.
In code, this:
var $form = $('#myFormId'),
firstName = $form.find('input[name="firstName"]').val(),
lastName = $form.find('input[name="lastName"]').val();
is cheaper then this:
var firstName = $('#myFormId input[name="firstName"]').val(),
lastName = $('#myFormId input[name="lastName"]').val();
It's also cheaper then using .children()
, see this reference, unless the items you are searching for direct children of the jQuery object you are operating on.
Hopefully that makes sense :)