You can also use event delegation to register one event handler on an element that contains your buttons (for example, the body of the document), and take advantage of the fact that events cause a bubble in the DOM.
, , .
.
document.observe( 'click', function( event )
{
var elem = event.element();
if ( elem.match( 'input[type="button"]' ) )
{
}
});