you can do this with a YUI events config. http://yuilibrary.com/yui/docs/view/#handling-dom-events