Sets element to display none if it has no children or if it’s a text element with no text