initFocusEvent method
Initializes a new focus event that the createEvent method created.
Important As of Microsoft Edge, the
createEvent()/initEvent() constructor pattern for synthetic events is deprecated. See the Synthetic Events page for more information.![]() ![]() |
Syntax
var retval = FocusEvent.initFocusEvent(eventType, canBubble, cancelable, viewArg, detailArg, relatedTargetArg );Parameters
- eventType [in]
-
Type: String
One of the following values, or a user-defined custom event type.
-
This event is an onblur event.
-
This event is an onfocus event.
-
This event is an onfocusin event.
-
This event is an onfocusout event.
- canBubble [in]
-
Type: Boolean
- cancelable [in]
-
Type: Boolean
- viewArg [in]
-
Type: IHTMLWindow2
The active window object or null. This value is returned in the view property of the event. - detailArg [in]
-
Type: Integer
A Integer value that specifies additional information. This value is returned in the detail property of the event.
- relatedTargetArg
-
Type: IEventTarget
The object used for the relatedTarget attribute of the new focus event.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Standards information
- Document Object Model (DOM) Level 3 Events Specification, Section 5.2.2
See also
Show:

