if i have to add your message is added alert in php code example
Example 1: How do I check if an element is hidden in jQuery?
// Checks CSS content for display:[none|block], ignores visibility:[true|false]
$(element).is(":visible");
// The same works with hidden
$(element).is(":hidden");
Example 2: How to show confirm message before delete using jquery
<button onclick="return confirm('Are you sure you want to Delete?');"
id="btnDelete">DELETE</button>