Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
Устарело: Эта возможность была удалена из веб-стандартов. Хотя некоторые браузеры по-прежнему могут поддерживать её, она находится в процессе удаления. Не используйте её ни в старых, ни в новых проектах. Страницы или веб-приложения, использующие её, могут в любой момент сломаться.
Примечание: Эта возможность доступна в Web Workers.
The Event.initEvent() method is used to initialize the value of an event created using Document.createEvent().
Events initialized in this way must have been created with the Document.createEvent() method. This method must be called to set the event before it is dispatched, using EventTarget.dispatchEvent(). Once dispatched, it doesn't do anything anymore.
Примечание: Не используйте этот метод, т.к. он устаревший. (deprecated)
Вместо него используйте такой специальный конструктор событий, как Event(). Страница Creating and triggering events даст больше информации о возможностях использования.
DOMString, определяющая тип события.
bubblesIs a Boolean deciding whether the event should bubble up through the event chain or not. Once set, the read-only property Event.bubbles will give its value.
cancelableIs a Boolean defining whether the event can be canceled. Once set, the read-only property Event.cancelable will give its value.
| DOM # dom-event-initevent |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 10 апр. 2026 г. by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.