Syntax to observe an element on an event:
Event.observe(element, event, function() {
console.log('Observation performed!');
});
The onfocus trigger is activated when the element is brought into focus. Using the Tab key to cycle through elements can activate it. So can clicking or selecting it. Even right-clicking on the element will trigger this event.
Focus: None
The onblur event is the opposite of onfocus. Once it stops becoming the focus, this is triggered.
Stops becoming focus can also mean that you click anywhere else on the page.
The onsubmit trigger can be used when a form is submitted, either by the submit button, or someone hitting 'Enter' to complete form entry.
If you wanted to cancel the submission, you'd need to use onsubmit on the form element directly, and return false.
onreset is available too.