How to Hide Elements based off other empty Elements?

has anyone found a working code exmaple that will hide/collapse an element if there is nothing in the dataset field box?