最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - is event.target deprecated? - Stack Overflow

programmeradmin4浏览0评论

MDN Web Docs specifications table for event.target indicates that it's status is obsolete in DOM level 2 and DOM4. does it mean it's deprecated and I no longer should use it?
If so what should I use instead?
I know my question is somehow ridiculous, cause event.target is so important and we use it everywhere, but I couldn't find something useful on the net, specially W3, and I'm still obsessed with the word Obsolete :), so I preferred to ask here. thanks

MDN Web Docs specifications table for event.target indicates that it's status is obsolete in DOM level 2 and DOM4. does it mean it's deprecated and I no longer should use it?
If so what should I use instead?
I know my question is somehow ridiculous, cause event.target is so important and we use it everywhere, but I couldn't find something useful on the net, specially W3, and I'm still obsessed with the word Obsolete :), so I preferred to ask here. thanks

Share Improve this question edited Mar 3, 2019 at 19:11 Daniel A. White 191k49 gold badges379 silver badges465 bronze badges asked Mar 3, 2019 at 19:07 amirifyamirify 8051 gold badge9 silver badges21 bronze badges 1
  • 1 The DOM Living Standard supersedes the other standards. So the older ones are obsolete. It's not going anywhere. – Scott Marcus Commented Mar 3, 2019 at 19:09
Add a ment  | 

2 Answers 2

Reset to default 5

You're misinterpreting MDN.

It says that the DOM4 and Document Object Model (DOM) Level 2 Events Specification's definitions of Event.target are obsolete, not that Event.target itself is obsolete.

The DOM (Living Standard) specification is not marked as obsolete and you should use that definition.

MDN documentation is prepared like so that you should not see the specification level that are obsolete. What you need to look at is to check out the current living standard. The status denoted by obsolete is just that specification not the method or property itself.

When any method or property is marked as obsolete, you'll see them in top like below. For eg. check eval:

Obsolete This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

发布评论

评论列表(0)

  1. 暂无评论