dima-kruglyak,
возможно вы хотели так ...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
.post{
border: solid hsla(240, 100%, 50%, 1) 2px;
height: 3px;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
var p = $('.post');
p.each(function(indx, el){
el.style.height = el.scrollHeight + 'px';
});
});
</script>
</head>
<body>
<div>
<div class="post">1</div>
<div class="post">2<br/></div>
<div class="post">3<br/>3</div>
</div>
</body>
</html>