JSFiddle - React, Tailwind, and code Playground

by DannyEnglander

HTML

page


<fieldset class="group-location field-group-fieldset form-wrapper" id="node_ticketed_event_full_group_location">
    
    <legend> 
   <span class="fieldset-legend">Location</span>
    </legend>
    
    <div class="fieldset-wrapper">
        <div class="field field-name-field-location field-type-addressfield field-label-hidden">
            <div class="field-items">
                <div class="field-item even"></div>
            </div>
        </div>
    </div>
    
</fieldset>

JavaScript

/*
$('fieldset').each(function() {
    var c = $(this).children().children().children().children(); 
    if (c.html().length == 0) { 
        $(this).hide();
    }
});
*/


$('fieldset').each(function() {
    var c = $(this).find('.field-item');
    if (c.html().length == 0) { 
        $(this).hide();
    }
});