- 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 visible at the top of a page in JavaScript?
Use the orphans property in JavaScript to set the minimum number of lines for an element that must be visible at the top of a page. You can try to run the following code to learn how to implement orphans property −
document.getElementById("p").style.orphans
This is how you can return the orphans property −
var res = object.style.orphans;
This is how to set the orphans property −
object.style.orphans='number|initial|inherit'
- Related Articles
- 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?
- How to set whether an element should be visible in JavaScript?
- How to set the top position of an element with JavaScript?
- How to set the top padding of an element with JavaScript?
- How to set the top margin of an element with JavaScript?
- How to set the minimum height of an element with JavaScript?
- How to set the minimum width of an element with JavaScript?
- How do we set the visible number of lines in a text area in HTML?
- How to set the page-break behavior after an element with JavaScript?
- How to set the page-break behavior inside an element with JavaScript?
- How to set the page-break behavior before an element with JavaScript?
- Set whether or not an element should be visible while not facing the screen with JavaScript?
- How to create a Javascript executor for making an element visible in Selenium Webdriver?
- Set the navigation bar to stay at the top of the web page with CSS
- How to set or return the number of columns an element should be divided into with JavaScript?

Advertisements