#jquery #:has() :has() :has() is a selector to use when selecting elements that contain a particular element. grammar $( ':has(selector)' ) for example $( 'p:has(span)' ) Select the p element that has a span element. example jQuery Selector - :has() Lorem Ipsum Dolor Sit Amet Select the li element that has the a element as a child element to create a red border.