You can count the number of text rectangles it uses with element.getClientRects() , which returns a ClientRect object for each border element of the element.This should be done on an inline element such as a <span> for each line of text to have its own border box, but it is simple enough to use:
window.onresize = function () { var span = document.getElementById("myDiv").getElementsByTagName("span")[0], rect = span.getClientRects(); if (rect.length > 1)
Andy e
source share