testing 'nodeType' instead of hasOwnProperty