Is it possible to use Javascript to detect when text is flowing out of its containing <div>
? For instance, if a text consists of 3 sentences and the last sentence is only partially displayed, can JavaScript be used to capture the entire last sentence or the first word that is not visible?
Example :
HTML
<div>loooooong loooooong text. Second sentence. Third sentence</div>
CSS
div {
max-width: 60px;
max-height: 50px;
overflow: hidden;
text-overflow: ellipsis;
}