Use the orphans 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.
You can return the orphans property like this −
var res = object.style.orphans
Set the orphans property like this −
object.style.orphans = 'number|initial|inherit'
The following are the property values shown above −
- number − Specify the minimum number of visible lines.
- Initial − Set property to its default
- Inherit − Inherits property from the parent element