Object Oriented Programming Articles

Page 70 of 589

How to set the top position of an element with JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 15K+ 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. ...

Read More

How to layout table cells, rows, and columns with JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 2K+ 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 ...

Read More

How to set when the transition effect will start with JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 2K+ Views

In this tutorial, we shall learn to set when the transition effect starts with JavaScript. To set when the transition effect will start, use the JavaScript transitionDelay property. To make interactive components, we go for transition effects. Here let us get deeper into the topic and understand how we can set the transition start. Using the Style transitionDelay Property With Style transitionDelay property, we can set or return when the transition effect starts. We can specify the transitionDelay value in seconds(s) or milliseconds(ms). The delay can be either negative, positive, or zero. The transition effect starts ...

Read More

How can I escape HTML special chars in JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 10K+ Views

HTML contains special characters such as '', '/' and many more such as single and double quotes. These special characters are used for HTML tags, such as '' are used to close HTML tags. This tutorial teaches us to escape HTML special characters in JavaScript. Now, the question is what if we want to use these characters inside the HTML content? If we use special characters normally in HTML content, it considers them as opening or closing HTML tags and produces an unknown error. For example, we need to render the below string to the browser: ...

Read More

How to clone an object in JavaScript?

Nikhilesh Aleti
Nikhilesh Aleti
Updated on 15-Mar-2026 5K+ Views

An object is said to be an entity which has properties and types in it. Example, consider a Person as an object and it has properties like height, weight, age and salary. In the similar way JavaScript also have objects and their defined properties. An object in JavaScript is a complicated data type where it can store various data types in it. Let's consider this example below: const employee = { ...

Read More

Garbage collection(GC) in JavaScript?

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 2K+ Views

Memory management in JavaScript is much easier than in low-level languages like C or C++. Unlike low-level languages, JavaScript automatically detects which objects will be needed in later cases and which will be garbage that is occupying memory without any reason. In this article, we shall discuss how garbage collection (GC) works in JavaScript. There are a few important parts that we are going to discuss in detail: Reachability from root Interlinked Objects (interconnections between different objects) Unreachable Collections (Broken link) Reachability The first concept of ...

Read More

Mixins in JavaScript

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 3K+ Views

Multiple-inheritance is not supported by JavaScript by default. But sometimes we need to mix multiple object properties into a single object. Object property sharing can be done using mixins. In this article, we shall cover what are mixins in JavaScript. The definition of mixins can be stated as mixins is a class that contains methods that can be used by other classes without inheriting from that class. The methods in mixin provide certain behavior which is not used alone but can be used to add these behaviors to other classes. Basic Mixin with Object.assign() See the following ...

Read More

JavaScript Detecting a mobile browser

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 255 Views

Detecting mobile browsers in JavaScript is essential for responsive web design and providing device-specific functionality. This can be achieved using the navigator.userAgent property to identify mobile device patterns. Basic Mobile Detection The most common approach uses regular expressions to check the user agent string for mobile device identifiers: Mobile Detection body { font-family: "Segoe ...

Read More

How to create a form with multiple steps in JavaScript?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 1K+ Views

Creating multi-step forms improves user experience by breaking complex forms into manageable sections. This approach reduces form abandonment and makes data collection more organized. Complete Multi-Step Form Example Here's a complete implementation of a multi-step registration form with validation and progress indicators: * { box-sizing: border-box; } body { background-color: #f1f1f1; } #regForm { margin: 100px auto; ...

Read More

Implementing Linear Search in JavaScript

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 513 Views

Linear search is a simple algorithm that sequentially checks each element in an array until the target element is found or the end of the array is reached. It has a time complexity of O(n) in the worst case. How Linear Search Works Linear Search Process Array: [1, 19, 5, 11, 22, 55] Target: 22 1 i=0 19 i=1 ...

Read More
Showing 691–700 of 5,881 articles
« Prev 1 68 69 70 71 72 589 Next »
Advertisements