dom3: fix case where target is a text node

This was throwing on IE when `e.target` was a text node, since text nodes don't have `getElementsByTagName`.