I need a way to count lines in the html so I can do logic for a business requirement.
I use Bootstrap + AngularJS but the solution could be in plain Javascript.
I have no idea where to start. Any help?
.myClass {
word-break: break-all;
white-space: pre-line;
}
<div style="max-width: 50px">
<span class="myClass">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</span>
</div>
<span>Total Lines: <b id="totalLines"></b></span>
I also would need a way to calculate this everytime the user makes the window smaller/bigger because of the responsive aspect.
""