admin管理员组文章数量:1129016
I'm wondering if there's a way to count lines inside a div for example. Say we have a div like so:
<div id="content">hello how are you?</div>
Depending on many factors, the div can have one, or two, or even four lines of text. Is there any way for the script to know?
In other words, are automatic breaks represented in DOM at all?
I'm wondering if there's a way to count lines inside a div for example. Say we have a div like so:
<div id="content">hello how are you?</div>
Depending on many factors, the div can have one, or two, or even four lines of text. Is there any way for the script to know?
In other words, are automatic breaks represented in DOM at all?
Share Improve this question asked Apr 23, 2009 at 22:58 buti-oxabuti-oxa 11.4k5 gold badges36 silver badges44 bronze badges 1
本文标签: javascriptHow can I count text lines inside an DOM element Can IStack Overflow