DHTMLX Docs & Samples Explorer

Index
dhtmlxcalendar

## Event Handling

The following events are available in dhtmlxCalendar:

- onClick Event - occurs when the user clicks the left mouse button on a date in the Calendar;
- onChangeMonth Event - occurs when the user changes the month in the Calendar by clicking the buttons “prev” and “next”.

### Attaching Event Handler

The user can add any user-defined handler to any of the available events. To do this, the user can use attachEvent() method that sets the function called when specified event occurs. It has the following parameters:

- evName - name of the event;
- evHandler - user-defined event handler.

       mCal.attachEvent(evName, evHandler);

Note: the names of the events are case-sensitive.