- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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?
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
- Related Articles
- How to set the minimum number of lines for an element that must be visible at the top of a page in JavaScript?
- How to set the page-break behavior inside an element with JavaScript?
- How to set the page-break behavior after an element with JavaScript?
- How to set the page-break behavior before an element with JavaScript?
- How to set the bottom padding of an element with JavaScript?
- How to set the bottom margin of an element with JavaScript?
- How to specify that an element should be pre-selected when the page loads in HTML?
- How to set the minimum height of an element with JavaScript?
- How to set the minimum width of an element with JavaScript?
- How to set the left padding of an element with JavaScript?
- How to set the left margin of an element with JavaScript?
- Usage of page-break-before, page-break-after, and page-break-inside properties in CSS
- How do I hide an element when printing a web page?
- Set the left, right, top and bottom padding of an element
- How to set the bottom margin of an element?

Advertisements