等同于onload和onclick?

Equivalant for onload and onclick?

专有onclik 已过时。我使用 addEventListener,这是一个示例 => myVariable.addEventListener('click', myFunction);

proprietie onload 的等价物是什么?

相当于document.addEventListener('load', function() {});

语法相似

object.addEventListener("load", myScript);

参考:

[1] https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event

[2] https://www.w3schools.com/jsref/event_onload.asp