TinyMCE:API/tinymce.dom.Event/add
From Moxiecode Documentation Wiki
Contents |
[edit]
Method: add
[edit]
Summary
Adds an event handler to the specified object.
[edit]
Syntax
<function> add(<Element/Document/Window/Array/String> o, <String> n, <function> f, <Object> s)
[edit]
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.
[edit]
Returns
Function callback handler the same as the one passed in.
[edit]
Examples
// Adds a click handler to the current document
tinymce.dom.Event.add(document, 'click', function(e) {
console.debug(e.target);
});
