Sign in


De-register an event handler that was previously registered with .watch().


neon.unwatch(string eventname, function callback)


The name of the event that was being watched.

This name should not include an "on" prefix.


The function that was previously registered.


This method should be executed on a selection of elements. Please see the .select() method.

Return value

This method is chainable. It returns a copy of the Neon object on which it was called.


This method removes an event handler registration that was previously set up with a similar call to .watch().

It is important that both parameters - the event name and the callback function - are identical to those provided to .watch(). The function must be the same function, and not just a function with the same name or behaviour.

It is not necessary to call .unwatch() on the same set of elements as the call to .watch(), as long as all the elements in the call to .unwatch() did have the event registered.

Events which are registered with .watch() should be de-registered with .unwatch(). It is not likely to work properly if an event is registered with watch() and de-registered with the W3C or Microsoft event handling functions, or vice-versa, although it is safe to have separate event handlers use those functions on the same page.