How to Check if Element is inside Another Specific Element?
Replace theĀ first selector with the child you are testing and the second selector with the parent you are testing for. if ( $(“.child-element”).parents(“#main-nav”).length == 1 ) { // YES, the child element is inside...