I am working with a variable containing a webpage element, such as a button. However, sometimes I get the error "Unable to access dead object" because the page containing the item has changed since it was saved.
I would like to know how to check if an element is dead or not, I tried:
if(element) alert("Do something");
but it does not work properly.
source share