On some older browsers event.target may be a text node (fixes #56)