attachEvent

attachEvent(eventName, callback)

Subscribes to the specified event and calls the callback function when the event fires.

Parameters:

Name Type Description
eventName string

The event name.

callback function

Function to be called when the event fires.

Returns:

This method doesn't return any data.