Suppose you have a div called 'myDiv':
<!-- In your HTML --> <div id='myDiv'>...</div>
You can hook a handler function called doSomething to it using Event.observe like so:
That's just one way, there are others that don't require that the div have an ID.
For more details, check out the Event Hooking "How To".
For more events see http://www.w3schools.com/jsref/jsref_events.asp - Remember to remove the prepended 'on' when coding