javascript count no of lines

Solutions on MaxInterview for javascript count no of lines by the best coders in the world

showing results for - "javascript count no of lines"
Martina
07 Mar 2018
1function getLinesCount(element) {
2  var prevLH = element.style.lineHeight;
3  var factor = 1000;
4  element.style.lineHeight = factor + 'px';
5
6  var height = element.getBoundingClientRect().height;
7  element.style.lineHeight = prevLH;
8
9  return Math.floor(height / factor);
10}
11