TinyMCE:API/tinymce.dom.Event/add

From Moxiecode Documentation Wiki

Jump to: navigation, search

Contents

Method: add

Summary

Adds an event handler to the specified object.

Syntax

<function> add(<Element/Document/Window/Array/String> o, <String> n, <function> f, <Object> s)

Parameters

o
Object or element id string to add event handler to or an array of elements/ids/documents.
n
Name of event handler to add for example: click.
f
Function to execute when the event occurs.
s
Optional scope to execute the function in.

Returns

Function callback handler the same as the one passed in.

Examples

// Adds a click handler to the current document
tinymce.dom.Event.add(document, 'click', function(e) {
   console.debug(e.target);
});
Personal tools