Iktash,
<!DOCTYPE HTML>
<html>
<head>
<title></title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(function(){
$(".star").each(function(indx, element){
var k = +$(element).html();
var star = '';
for (var i = 0; i < 5; i++) {
star +=i < k ? "<img src='http://javascript.ru/forum/images/smilies/dance3.gif' />":"<img src='http://javascript.ru/forum/images/smilies/agree.gif' />";
}
$(element).html(star)
});
});
</script>
</head>
<body>
<div id = '1' class = 'star'>1</div>
<div id = '2' class = 'star'>2</div>
<div id = '4' class = 'star'>3</div>
<div id = '5' class = 'star'>4</div>
<div id = '7' class = 'star'>5</div>
</body>
</html>