JavaScript
- 2 ответа
- 0 вопросов
1
Вклад в тег
document.documentElement.addEventListener("click", function(e) {
console.log(e.type, e);
})
document.documentElement.addEventListener("magic", function(e) {
console.log(e.type, e);
})
var event = new Event("click", {bubbles : true, cancelable : true})
var customEvent = new CustomEvent("magic", {bubbles : true, cancelable : true, detail : "<any string data>"})
document.documentElement.dispatchEvent(event);
document.documentElement.dispatchEvent(customEvent);