how to check if child class exists or not using id jquery code example
Example 1: detect if an element has a class jQurey
$("#EL_ID").hasClass("CLASS_NAME");
Example 2: check class exist in element by parent id in jquery
$(this).parent().find('.accordion-body').length == 1;
or you can use hasClass()