check if an element is document