Created
September 18, 2020 08:31
-
-
Save sabrina-zeidan/d6fbea725f6933ce92735a44c76aa8cd to your computer and use it in GitHub Desktop.
Hide child if parent has (not) another child with class [JS]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//<div class="elementor-column"><div class="dce-acf-repater-"><div class="repeater-item"></div></div><div class="elementor-widget-button"></div></div> | |
(function( $ ){ | |
$(".elementor-column .dce-acf-repater-").each(function() { | |
if (!$(this).has(".repeater-item").length) { | |
hide = $(this).closest('.elementor-column').find(".elementor-widget-button").hide(); | |
} | |
}); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment