root.addEventListener
заменить слушателями на елементах с требуемым id
The “Same Origin” policy states that: ... open or a window inside , and that window comes from the same origin, then we have full access to that window. otherwise, if it comes from another origin, then we can't access the content of that window: variables, document, anything
new Promise((resolve) => {
resolve('много вычислений')
}).then((result) =>
console.log(result));
console.log("d");
Promise.resolve('много вычислений').then((result) => console.log(result));
console.log("d");
button.addEventListener('click', event => {
console.log(event.detail);
});