$('ul li:has(ul.child)').addClass('has_child');
Ref:
https://www.geeksforgeeks.org/how-to-apply-style-to-parent-if-it-has-child-with-css/
Article ID: 52
Created On: Thu, Oct 8, 2020 at 2:07 PM
Last Updated On: Thu, Oct 8, 2020 at 2:07 PM
Authored by: Saeed Nobakht [[email protected]]
Online URL: https://www.navel.ir/article/how-to-apply-style-to-parent-if-it-has-child-with-css-52.html