![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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
Found 9326 Articles for Object Oriented Programming
![Krantik Chavan](https://www.tutorialspoint.com/assets/profiles/13545/profile/60_126883-1512724834.jpg)
57 Views
Use the alignContent property in JavaScript to set the alignment between the items inside a flexible container.ExampleYou can try to run the following code to implement alignContent property in JavaScript − #box { border: 1px solid #000000; width: 240px; height: 150px; flex-flow: row wrap; align-content: space-around; display: flex; } #box div { height: 80px; width: 80px; } DIV1 DIV2 DIV3 Set function display() { document.getElementById("box").style.alignContent = "space-between"; }
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
83 Views
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.orphansThis 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'
![Abhinanda Shri](https://www.tutorialspoint.com/assets/profiles/13552/profile/60_73264-1512711555.jpg)
134 Views
If you want to define a new or modify a property on an object, then use the Object.defineProperty in JavaScript. Use the property like the following −Object.defineProperty(obj, prop, descriptor)The following are the parameters −obj – Property is defined on this object. prop – Name of the property descriptor − The descriptor for the propertyExampleYou can try to run the following code to learn how to implement Object.defineProperty in JavaScript − const obj = {}; Object.defineProperty(obj, 'prop', { value: 20, writable: false }); obj.prop = 10; document.write(obj.prop);
![Srinivas Gorla](https://www.tutorialspoint.com/assets/profiles/13556/profile/60_78057-1512712331.jpg)
77 Views
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.orphansSet 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 defaultInherit − Inherits property from the parent element
![Nancy Den](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
399 Views
Use the pageBreakBefore property in JavaScript to set the page-break behavior before an element. Use the always property to insert a page break before an element.Note − The changes would be visible while printing or viewing the print preview.ExampleYou can try to run the following code to return the page-break behavior before an element with JavaScript − Heading 1 This is demo text. This is demo text. This if footer text. Set page-break function display() { document.getElementById("myFooter").style.pageBreakBefore = "always"; }
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
2K+ Views
Use the pageBreakInside property in JavaScript to set the page-break behavior inside an element. Use the auto property to insert page break inside an element. Use auto or avoid property value to automatically insert page break inside an element, if needed, or avoid a page break, respectively.Note − The changes would be visible while printing or viewing the print preview.ExampleYou can try to run the following code to return the page-break behavior inside an element with JavaScript − Heading 1 This is demo text. This is demo text. This ... Read More
![Nikitha N](https://www.tutorialspoint.com/assets/profiles/13558/profile/60_76068-1512713229.jpg)
624 Views
Use the pageBreakAfter property in JavaScript to set the page-break behavior after an element. Use the always property for page after an element.Note − The changes would be visible while printing or viewing the print preview.ExampleYou can try to run the following code to return the page-break behavior after an element with JavaScript − Heading 1 This is demo text. This is demo text. This if footer text. Set page-break function display() { document.getElementById("myFooter").style.pageBreakAfter = "always"; }
![Priya Pallavi](https://www.tutorialspoint.com/assets/profiles/13562/profile/60_91320-1512544134.jpg)
50 Views
Use the flexGrow property to set how much the item will grow relative to the rest with JavaScript.ExampleYou can try to run the following code to learn how to work with flexGrow property − #box { border: 1px solid #000000; width: 250px; height: 150px; display: flex; flex-flow: row wrap; } #box div { flex-grow: 0; flex-shrink: 1; flex-basis: 20px; } DIV1 DIV2 DIV3 Using flexGrow property Set function display() { document.getElementById("myID").style.flexGrow = "2"; }
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
145 Views
Use the flexFlow property to set the flexible items to be visible in columns.ExampleYou can try to run the following code to make flexible items display in columns with JavaScript − #box { border: 1px solid #000000; width: 100px; height: 150px; display: flex; flex-flow: row wrap; } #box div { height: 40px; width: 40px; } DIV1 DIV2 DIV3 Using flexDirection property Set function display() { document.getElementById("box").style.flexFlow = "column nowrap"; }
![Abhinaya](https://www.tutorialspoint.com/assets/profiles/13548/profile/60_54851-1512705920.jpg)
69 Views
Use the flex property in JavaScript to set the length of the item relative to the rest. You can try to run the following code to implement flex property with JavaScript −Example #box { border: 1px solid #000000; width: 300px; height: 400px; display: flex; } DIV1 DIV2 DIV3 Set function display() { var a = document.getElementById("box"); var b = a.getElementsByTagName("DIV"); var j ; for (j = 0; j < b.length; j++) { b[j].style.flex = "1"; } }