Share via


fromElement Property

Returns an IHTMLElement object that represents the element the mouse pointer is exiting during an onmouseover or onmouseout event.

expression.fromElement

*expression   * Required. An expression that returns an IHTMLEventObj object.

Remarks

See also the srcElement and toElement properties.

Example

The following example makes the text in the specified element bold, if it is not already bold. This example must be placed in a class module, and it assumes that you have declared in the General Declarations section of a class module an FPHTMLParaElement object variable called "objPara" using the WithEvents keyword.

Private Sub objPara_onmouseover()
    
    Dim objEvent As IHTMLEventObj
    Dim objElement As IHTMLElement
    
    Set objEvent = objWindow.event
    Set objElement = objEvent.fromElement
    
    If objElement.Style.fontWeight <> "bold" Then _
        objElement.Style.fontWeight = "bold"
    
End Sub

Applies to | IHTMLEventObj Object