onfocus Property
Returns or sets a Variant that represents the value of the onfocus attribute that is the script to run when the onfocus event fires.
expression.onfocus
*expression * Required. An expression that returns one of the objects in the Applies To list.
Example
The following example sets the onfocus attribute for the first IMG element in the active document.
Dim objImage As FPHTMLImg
Set objImage = ActiveDocument.all.tags("img").Item(0)
objImage.onfocus = "script()"
Applies to | FPHTMLAnchorElement Object | FPHTMLAreaElement Object | FPHTMLBody Object | FPHTMLButtonElement Object | FPHTMLDivPosition Object | FPHTMLEmbed Object | FPHTMLFieldSetElement Object | FPHTMLFrameBase Object | FPHTMLFrameElement Object | FPHTMLFrameSetSite Object | FPHTMLIFrame Object | FPHTMLImg Object | FPHTMLInputButtonElement Object | FPHTMLInputFileElement Object | FPHTMLInputHiddenElement Object | FPHTMLInputImage Object | FPHTMLInputTextElement Object | FPHTMLLegendElement Object | FPHTMLMarqueeElement Object | FPHTMLObjectElement Object | FPHTMLSelectElement Object | FPHTMLSpanFlow Object | FPHTMLTable Object | FPHTMLTableCaption Object | FPHTMLTableCell Object | FPHTMLTextAreaElement Object | FPHTMLWindow2 Object | FPHTMLWindowProxy Object | IHTMLAnchorElement Object | IHTMLAreaElement Object | IHTMLControlElement Object | IHTMLWindow2 Object