create_event method
create_event
Creates an Event of a type supported by the implementation.
Returns
The newly created Event
def create_event(self, event_type):
    ...
| Parameter | Type | Description | 
|---|---|---|
| event_type | str | The eventType parameter specifies the type of Eventinterface to be created.If the Eventinterface specified is supported by the implementation this method willreturn a new Eventof the interface type requested.If the Eventis to be dispatched via theIEventTarget.dispatch_eventmethod the appropriateEvent.init_eventmethod must be called after creation in order to initialize the Event’s values.The IDocumentEvent.create_eventmethod is used in creatingEvents when it is either inconvenient or unnecessaryfor the user to create an Eventthemselves.In cases where the implementation provided Eventis insufficient, users may supplytheir own Eventimplementations for use with theIEventTarget.dispatch_eventmethod. | 
Exceptions
| Exception | Description | 
|---|---|
| DOMException | NOT_SUPPORTED_ERR: Raised if the implementation does not support the type of Eventinterface requested | 
See Also
- module aspose.html
- class DOMException
- class Event
- class HTMLDocument