jQuery if has class then show if ($('.client-message')[0]){ $("#message-toaster-close").css("display", "block");