jquery check if an elemet is present then hide another onw code example
Example: jquery how to know if element is visible
// Checks CSS content for display:[none|block], ignores visibility:[true|false]
$(element).is(":visible");
// The same works with hidden
$(element).is(":hidden");