Check if any ancestor has a class using jQuery October 24, 2022 by Tarik if ($elem.parents('.left').length) { }