<!DOCTYPE>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<style type="text/css">
#qqq > div {
height:20px;
width:200px;
border:solid red 2px;
padding: 0 5px;
margin:2px;
}
</style>
</head>
<body>
<div id='qqq'>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<script type="text/javascript">
$('#qqq div').click(function(){
$(this).text($(this).index());
});
</script>
</body>
</html>