object.event和object.addEventListener(event,function)有什么区别?

时间:2018-10-17 21:00:12

标签: javascript

我试图更好地了解HTML5视频的事件监听器。我目前正在查看play and playing events on W3SchoolsIt shows in their onplaying examples我可以执行以下任一操作:

object.onplaying = function(){myScript};

object.addEventListener("playing", myScript);

他们似乎做的完全一样。是他们还是我应该考虑的细微差别?如果它们完全相同,为什么addEventListener存在?

0 个答案:

没有答案