PonyS,
<!doctype html>
<html>
<head>
<meta charset="utf-8" /
<title></title>
<style>
.select {
background: red;
}
</style>
</head>
<body>
<p class="price">1</p>
<p class="price">2</p>
<p class="price">3</p>
<p class="price">4</p>
<p class="price">5</p>
<p class="price">6</p>
<p class="price">7</p>
<p class="price">8</p>
<p class="price">9</p>
<p class="price">10</p>
<input type="hidden" value="5" />
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script>
var count = $('input[type=hidden]').val();
$('.price:lt(' +count+ ')').click(function() {
$(this).toggleClass('select');
});
</script>
</body>
</html>