- 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
1K+ Views
In this tutorial, we will learn how to lay out table cells, rows, and columns with JavaScript. We can construct and edit DOM (Document Object Model) elements using JavaScript. There are two ways to add HTML components, such as tables, to an HTML document. The first is to include the HTML table tag directly into our HTML webpage, and the second is to create the full table within our JavaScript code. The second method is the most commonly used for building and adding tables to the DOM. The tr abbreviation refers to the table row. This reflects the complete table ... Read More
481 Views
Use the paddingLeft property in JavaScript to set the left padding. You can try to run the following code to return the left padding of an element with JavaScript −Example #box { border: 2px solid #FF0000; width: 150px; height: 70px; } This is demo text. Left padding function display() { document.getElementById("box").style.paddingLeft = "100px"; }
4K+ Views
In this tutorial, we will look at the methods to set the padding of an element with JavaScript. All of us know that there are margins and padding available in JavaScript. Then, what exactly is the padding of an element? Padding can be termed as the space between an element's content and its border, whereas margin adds space around the edge. Use the padding property in JavaScript to set the padding of an element Let us check out the method to set the padding. Using the Style padding Property In this section, let us discuss the padding property. ... Read More
512 Views
To set the bottom padding, use the paddingBottom property in JavaScript.ExampleYou can try to run the following code to return the bottom padding of an element with JavaScript − #box { border: 2px solid #FF0000; width: 150px; height: 70px; } This is demo text. Bottom padding function display() { document.getElementById("box").style.paddingBottom = "100px"; }
11K+ Views
In this tutorial, we shall learn to set the top position of an element with JavaScript. To set the top position of an element, we can use the DOM Style top property in JavaScript. Alternatively, we can use the DOM Style setProperty() method. Let us discuss our topic in brief. Using the Style top Property We can set or return the top position of an element using the JavaScript DOM style top property. Following is the syntax to set the top position of an element using the Style top property with the dot notation or square brackets. Syntax object.style.top = ... Read More
323 Views
In this tutorial, we will learn to set whether or not an element is resizable by the user with JavaScript. Use the resize property to set whether the element is resizable by the user or not. The elements on a webpage are fixed on their position and size. But, sometimes, you need to give access to a user to increase the size or change the position of an element. The resize property of CSS gives us a way to change the size of an element. JavaScript DOM nearly provides all the styling properties provided by the CSS. We can even ... Read More
180 Views
In this tutorial, we will learn how to set the painting area of the background with JavaScript. The task is to define the background painting area. The background-clip property is commonly used to square measure the painting space of any web page's background. It specifies that we will modify the webpage's background regarding its contents or images/videos. The background-clip property specifies whether the background of an element extends beneath its border-box, padding box, or content box. If the element does not have a background image or color, this property has no visual effect unless the border has transparent or partially ... Read More
2K+ Views
In this tutorial, we shall learn to set the right position of a positioned element with JavaScript. What is a positioned element? The available position values in JavaScript are relative, absolute, fixed, or static. The static position is the default position value. Static elements are in the document order. A positioned element's position is based on its properties like the top, right, bottom, and left. We must set the position in every direction to align the elements as required. Here we are going to see the right position property. Let us get deeper into the topic and understand how to ... Read More
161 Views
In this tutorial, we shall learn to set the type of positioning method used for an element with JavaScript. The positioning permits us to move elements out of actual document order and make them appear in various ways. For instance, stay on top of one another or occupy the initial position within the browser viewport. Let us understand how to set the type of positioning method. Using the Style position Property With the Style "position" property, we can set or return the type of positioning method used for an element. The available position values are relative, absolute, fixed, sticky, and ... Read More
748 Views
To change the width of a table border, use the DOM border property. You can try to run the following code to change the width of a table border in JavaScript −Example function borderFunc(x) { document.getElementById(x).style.border = "5px dashed blue"; } One Two Three Four Five Six