Put text in a div until div is at max height with javascript

  css, html, javascript, php

i have a large textblock that is filled with text by a js script but i only want to fill it until max height is met.

The reason is afterwards i want to pick a word at random and let it get bigger and shine then go back and let another random word do the same thing again.

Anybody has done this in the past ?
Would be nice if someone could help.


if it helps with solving my problem (and not losing reputation) here is some code didnt know it would be of any use.

    <div class="">
            <div class="overflow-hidden" id="gutenacht"> texthere </div>

the text shall be pulled into a variable afterwards so i dont want to hide any overflow.
Instead there should exist no overflow

The pulled Text is nearly infinitely long.

Source: Ask PHP