createEventObject method

Creates an event object that can be used to pass event context information to the PUBLIC:EVENT element's fire method.


var ppEventObject = element.createEventObject();


  • ppEventObject [out, retval]
    Type: [IHTMLEventObj](aa703876(v=vs.85).md)

    Returns an event object.

Return value

This method does not return a value.


The same event object cannot be reused in multiple calls to the fire method.

All properties of the event object that is created using IHTCDefaultDispatch::createEventObject are read/write, including those properties that would be read-only in Dynamic HTML (DHTML). You can use the HTML Component (HTC) file to set properties on the event object before firing an event.


This example is derived from a calculator behavior sample. When the result changes, the behavior fires a custom onResultChange event back to the page, passing the result as a custom property of the event object.

<public:event name="onResultChange" id="rcID" />

<script language="javascript">

function doCalc()
   oEvent = createEventObject();
   oEvent.result = sResult; (oEvent);

This example shows what the containing page looks like.

<html xmlns:InetSDK>
@media all {
   InetSDK\:CALC    {behavior:url(} 

<InetSDK:CALC id="myCalc"
<tr><div id="resultWindow" style="border: 0.025cm solid gray;" align="right">0.</div></tr>
<tr><td><input type="button" value=" 7 "></td>
    <td><input type="button" value=" 8 "></td>
    <td><input type="button" value=" 9 "></td>
    <td><input type="button" value=" / "></td>
    <td><input type="button" value=" C "></td>

Code example:

See also





Introduction to DHTML Behaviors

Introduction to Viewlink

About Element Behaviors