Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery check if element still exists

$(function() {
    var $button = $(".the_button");
    alert (isStale($button));
    $button.remove();
    alert (isStale($button));
});
    
function isStale($elem)
{
    return $elem.closest("body").length > 0;
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jquery #check #element #exists
ADD COMMENT
Topic
Name
1+4 =