Вроде очень даже удобная схема получается
<input type="button" value="click" class="but1">
<input type="button" value="click" class="but2">
<script>
window.onload = function () {//onload begin
document.body.onclick = function (e) {//onclick begin
e = e || event;
var target = e.target || e.srcElement;
if (target.className == 'but1') {
alert(target.className);
return;
}
if (target.className == 'but2') {
alert(target.className);
return;
}
}//onclick end
}//onload end
</script>
<input type="button" value="click" class="but1">
<input type="button" value="click" class="but2">
<script>
window.onload = function () {//onload begin
document.body.onclick = function (e) {//onclick begin
e = e || event;
var target = e.target || e.srcElement;
if (target.className == 'but1') {
alert(target.className);
} else
if (target.className == 'but2') {
alert(target.className);
}
}//onclick end
}//onload end
</script>
<input type="button" value="click" class="but1">
<input type="button" value="click" class="but2">
<script>
window.onload = function () {//onload begin
document.body.onclick = function (e) {//onclick begin
e = e || event;
var target = e.target || e.srcElement;
switch (target.className) {//switch begin
case 'but1': {
alert(target.className);
break;
}
case 'but2': {
alert(target.className);
break;
}
}//switch end
}//onclick end
}//onload end
</script>