I am new to jquery and I am having a problem understanding the Jquery.find() method. I have been reading other responses but I feel like I am still missing something.
I am doing an ajax call and getting a html return.
<!DOCTYPE html>
<head><title></title></head>
<body>
<form name="CALC"><table>....</table></form>
</body>
</html>
Then I do a
$(data).find('table');
and everything works as expected however when I do a similar ajax call and get the following html
<!DOCTYPE html>
<head><title></title></head>
<body>
<div class="paraSearch">.....</div>
</body>
Then I do a
$(data).find('.paraSearch');
I do not receive the div object. Instead the div I am looking for is in the prevObject array. However what does work is if I call:
$(data).closest('.paraSearch');
I understand that find() can return an array because it can select multiple elements. But then why does the first version work?
Thanks for the explanation!
UPDATE
Just to clarify my issue problem is that when I try to append the file that has the ajax call with so:
var content = $( data).find( '.paraSearch' );
$(sectionName).append(content);
Nothing is added.