How to set the minimum number of lines for an element that must be left at the bottom of a page when a page break occurs inside an element with JavaScript?

JavascriptObject Oriented ProgrammingFront End Technology

<p style="">Use the <em>orphans</em> property in JavaScript to set the minimum number of lines for an element that should be left at the bottom of a page when a page break occurs inside an element with JavaScript.</p><p style="">You can return the orphans property like this &minus;</p><pre class="result notranslate">var res = object.style.orphans</pre><p style="">Set the orphans property like this &minus;</p><pre class="result notranslate">object.style.orphans = &#39;number|initial|inherit&#39;</pre><p>The following are the property values shown above &minus;</p><ul class="list"><li><strong>number &minus;</strong> Specify the minimum number of visible lines.</li><li><strong>Initial &minus;</strong> Set property to its default</li><li><strong>Inherit &minus;</strong> Inherits property from the parent element</li></ul>
raja
Updated on 23-Jun-2020 12:33:48

Advertisements