<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="http://yandex.st/jquery/1.7.2/jquery.js"></script>
<script type="text/javascript">
$(function(){
$("#classPanel").on('click', 'button', function(){
alert($(this).attr('class'));
});
});
</script>
</head>
<body>
<div id="classPanel">
<button type='button' class='class1'>class1</button>
<button type='button' class='class2'>class2</button>
<button type='button' class='class3'>class3</button>
<button type='button' class='class4'>class4</button>
<button type='button' class='class5'>class5</button>
<button type='button' class='class6'>class6</button>
</div>
</body>
</html>
button можно заменить на любой другой тег, например: div или span