There is the following code:

<div class="select form_select"> <span>Прямая</span> <div class="select_list"> <div>Прямая</div> <div>Угловая</div> <div>С островом</div> <div>П-образная</div> </div> </div> 

How when clicking on a child block div with a class .select_list find out if the second-level parent .select class .form_select ?

    1 answer 1

    For example:

     $('.select.form_select .select_list > div').on('click', function(){ if ($(this).parent().parent().hasClass('form_select')) { ... } }); 

    Or so, although the check here is not as strict as in the task:

     $('.select.form_select .select_list > div').on('click', function(){ if ($(this).closest('.form_select').length > 0) { ... } });