JQUERY – SELECT ELEMENTS WITH OR WITHOUT SPECIFIC CHILD

In jQuery, the has() method allow us to reduce the set of matched elements which only contains the specified child. For example:

Alternatively, if you want to select the specific li which doesn’t contains ul, try the following: