Seems pretty easy. When you search for an element with jQuery, the length
property indicates how many elements were found.
jQuery(function($) { // run when the document is "ready"
if ($('#found').length === 0) {
$('#hide-me').hide()
}
})
4
solved Hide a div element when other div is not found [closed]