event.currentTarget in IE6

前端 未结 2 1575
情书的邮戳
情书的邮戳 2021-01-22 13:32

I\'ve got an event handler that I\'m attaching to an element to catch a bubbled click event. I need a reliable way of obtaining the element that caught<

2条回答
  •  温柔的废话
    2021-01-22 14:07

    According to this article IE simply has no equivalent to currentTarget. Therefore, if you can't find a way to bind the events such that you get the correct element in target/srcElement, you could try adding a class to the element that you want to catch the event and traversing the DOM tree up to this element.

提交回复
热议问题