Issue #2347647 by eshta: Type check added in DOM selector.