PonyS,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script>
$(function(){
var html = $.map($('.select'),function(el) {
return el.textContent
})
$('input[name=mest]').val(html);
})
</script>
</head>
<body>
<div class="select">1</div>
<div class="select">2</div>
<div class="select">3</div>
<div class="select">4</div>
<div class="select">5</div>
<input type="text" name="mest">
</body>
</html>