jQuery search element

Sure :slight_smile:

const $outer = $('.outer').first();
const $inner = $outer.find('.inner').first();

Of course the above will return two jQuery objects as opposed to DOM node references. If you want the node reference, just grab the first element in the collection:

const $outer = $('.outer').first();
console.log($outer);
console.log($outer[0]);

// Object { 0: div.outer, length: 1, prevObject: {…} }
// <div class="outer">

Out of interest, why do you want to do that? document.querySelector is supported in all modern browsers and even in IE11.

1 Like