observe

observe(element, eventName, handler[, useCapture = false]) -> HTMLElement

Registers an event handler on element and returns element.

This is a simple proxy for Event.observe. Please refer to it for further information.

Example


$(element).observe('click', function(event){
  alert(Event.element(event).innerHTML);
 });
// -> HTMLElement (and will display an alert dialog containing 
// element's innerHTML when element is clicked).