Share via


onload Property

Returns or sets a Variant that represents the value of the onload attribute that is the name of the script to run when the onload event fires.

expression.onload

*expression   * Required. An expression that returns one of the objects in the Applies To list.

Example

The following example sets the onload attribute for the BODY element in the active document.

ActiveDocument.body.onload = "script()"

Applies to | FPHTMLBody Object | FPHTMLFrameSetSite Object | FPHTMLImg Object | FPHTMLInputImage Object | FPHTMLLinkElement Object | FPHTMLStyleElement Object | FPHTMLWindow2 Object | FPHTMLWindowProxy Object | IHTMLBodyElement Object | IHTMLFrameSetElement Object | IHTMLImgElement Object | IHTMLInputImage Object | IHTMLLinkElement Object | IHTMLStyleElement Object | IHTMLWindow2 Object