Answers for "how to check if a element div or not in jquery"

-1

jQuery exists function

if ($("#myElementID").length){
   //I exist
}
Posted by: Guest on July-22-2019
-2

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;
};
Posted by: Guest on April-17-2020

Code answers related to "how to check if a element div or not in jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language