Imagine a website with an element The site wants to run some JS which will fill the div with random text, when the div is full it should clear and start over. Yes I know that sounds weird but the question is, how can the JS know when the div is full, and would start to overflow?
By 'full', I mean no more visible text can be put in the div. I suppose this is the point a scroll bar would become enabled/visible.