Strict type comparison for elem.nodeType