Shouldn't this code be testing a DOM node, not an object literal?