Update test to use nodeType rather than instanceof for better browser compatability