Front End Technology Articles

Page 356 of 652

How to print content of JavaScript object?

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

In this tutorial, we will learn to print the content of a JavaScript object. Objects are similar to variables, but they can contain many values. Javascript object values are written as key: value pairs, and each pair is separated by commas. It is used to access data from databases or any other sources. Following are the ways to print the content of JavaScript objects − Using the JSON.stringify() Method Using Object.values() Using a for-in loop Using JSON.stringify() Method The JSON.stringify() method converts JavaScript objects ...

Read More

How to replace all dots in a string using JavaScript?

Prabhdeep Singh
Prabhdeep Singh
Updated on 15-Mar-2026 5K+ Views

In this tutorial, we will explore different ways to replace all dots in a string using JavaScript. While it's possible to remove all occurrences of dots manually with a for loop, JavaScript provides built-in methods that make this task much simpler. The two most popular methods for replacing all dots in a string are: Using the replaceAll() Method The replaceAll() method replaces all occurrences of a specified pattern with a replacement string. This is the most straightforward approach for replacing all dots. Syntax string.replaceAll(searchValue, replaceValue) Parameters searchValue ...

Read More

How to display HTML element with JavaScript?

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

In this tutorial, we will learn how to display an HTML element using JavaScript. HTML elements are the components that make up an HTML format file. These components are in charge of constructing web pages and defining their content. In HTML, an element typically consists of a start tag, content, and a closing tag. Some HTML elements are − Starting Tag Content Ending Tag ...

Read More

How to set the color of the left border with JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 764 Views

In this tutorial, we will learn how to set the color of the left border with JavaScript. To set the color of the left border in JavaScript, use the borderLeftColor property. Set the color on this property that you want for the border. We could also apply the borderColor property to set the color of the left border. A border is an HTML element's outline. Different sides can be set with different border colors. To set the color of the left border with JavaScript, we have different ways − Using the style.borderLeftColor property ...

Read More

Is their a JavaScript Equivalent to PHP explode()?

Ankith Reddy
Ankith Reddy
Updated on 15-Mar-2026 2K+ Views

The JavaScript equivalent to PHP's explode() function is split(). Both functions break a string into an array based on a specified delimiter. Syntax string.split(separator, limit) Parameters separator: The character or string to split by (required) limit: Maximum number of splits (optional) Basic Example JavaScript split() Example var str = '087000764008:Rank:info:result'; var arr = str.split(":"); ...

Read More

How to create JavaScript data grid for millions of rows?

Nancy Den
Nancy Den
Updated on 15-Mar-2026 377 Views

Displaying millions of rows efficiently requires JavaScript grids that use virtual rendering techniques. These grids only render visible rows in the DOM, dramatically improving performance compared to traditional approaches that render all data at once. Popular Data Grids for Large Datasets S. No Grid Description Max Rows ...

Read More

How and why does 'z'['toUpperCase']() in JavaScript work?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 326 Views

In JavaScript, the syntax 'z'['toUpperCase']() works because strings are objects, and you can access object methods using both dot notation and bracket notation. This alternative syntax calls the toUpperCase() method on the string 'z', converting it to uppercase. Syntax 'z'['toUpperCase']() // Returns 'Z' This is equivalent to the more common dot notation: 'z'.toUpperCase() // Returns 'Z' Why Does This Work? In JavaScript, there are two ways to access object properties and methods: Dot notation: object.property Bracket notation: object['property'] String literals like ...

Read More

How to set the style of the left border with JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 381 Views

In this tutorial, we shall learn how to set the style of the left border with JavaScript. To set the style of the left border in JavaScript, use the borderLeftStyle property. Set the style under this property that you want for the border i.e. solid, dashed, etc. Using the borderLeftStyle Property With this property, we can set or return the style of the left border of an element. Syntax object.style.borderLeftStyle = style; This syntax allows the required border style to be set to the element's style. Parameters ...

Read More

How to create a JavaScript code for multiple keys pressed at once?

Arjun Thakur
Arjun Thakur
Updated on 15-Mar-2026 745 Views

Use the keydown and keyup events in JavaScript to detect multiple keys pressed simultaneously. This technique tracks which keys are currently held down and updates the display accordingly. Example: Multiple Key Detection Multiple Keys Detection .key-up { color: red; } .key-down { color: green; } ul { list-style-type: none; } ...

Read More

Create a syntax highlighting code with JavaScript.

Srinivas Gorla
Srinivas Gorla
Updated on 15-Mar-2026 232 Views

Creating syntax highlighting for code blocks enhances readability and user experience. JavaScript offers several libraries for this purpose, with Google's Prettify being one of the simplest options. Using Google Prettify Library Prettify is a lightweight JavaScript library that automatically highlights code syntax. Include it in your HTML document: Basic Implementation Add the prettyprint class to any or element: function greetUser(name) { return "Hello, " + name + "!"; } ...

Read More
Showing 3551–3560 of 6,519 articles
« Prev 1 354 355 356 357 358 652 Next »
Advertisements