I want to dynamically calculate number of lines of text inside HTML element (fyi. I want to use show more/less solution for long texts not just character count). Let's have this generated html code (the number of lines may vary depending on the screens's resolution)
<span>
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Aliquam
vestibulum morbi blandit cursus risus at ultrices. Quisque non tellus
orci ac auctor augue mauris augue neque. Sed odio morbi quis commodo
odio. Aliquet"
</span>
Render:
I have tried this solution, but el.style.lineHeight
is not set.
`, ``, etc.
– Kirill Simonov Oct 07 '19 at 23:07