How can you check if a DOM element is a descendant of another DOM element?
Explanation
Syntax:

$(container).has(contained );
Note: here container and contained are selectors.
Check to see if a DOM element is a descendant of another DOM element.

Thanks, @docahrens! Improved)

2016 Jun 20, 4:07:36 PM

Your correct answer is incorrect. $.contains() specification says 'Select all elements that contain the specified text.' $.has() is the correct answer - from the jQuery specification: 'Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.'

2016 Jun 17, 11:20:48 PM

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes