Web Development Articles

Page 369 of 801

How to work with Structs in JavaScript?

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

In this tutorial, let us discuss how to work with structs in JavaScript. What is a struct? A struct is the short name of the data structure. The structure creates multiple values of different types in a single variable. We can use a struct to generate records. JavaScript doesn't have built-in struct support like C or C++. However, we can simulate struct-like behavior using JavaScript objects and constructor functions. Let us see the methods to create a structure. Using the String split() Method We can create a struct constructor dynamically by parsing a comma-separated string of ...

Read More

How to set the color of the rule between columns with JavaScript?

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

In this tutorial, we will learn how to set the color of the rule between columns with JavaScript. Multiple columns are used to increase the readability of long paragraphs or articles. The column-count CSS property is used to divide the text into columns. To set the color of the rule between columns with JavaScript, we use the columnRuleColor property of the style object. Using the style.columnRuleColor Property In JavaScript, the style.columnRuleColor property of an element is used to set the color of the rule between columns. We can set colors using color names, hex codes, or RGB ...

Read More

How to set the font family for text with JavaScript?

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

In this tutorial, we will learn how to set the font family for text with JavaScript. The font-family is a CSS property that specifies a prioritized list containing one or more font family names and generic family names for the text of an HTML element. To set the font-family for text with JavaScript, we have multiple ways, and in this tutorial, we will discuss two of them − Using the style.fontFamily Property Using the style.setProperty Method Using the style.fontFamily Property The style.fontFamily property sets a list of font ...

Read More

Does it make sense to use HTML comments on blocks of JavaScript?

Sravani Alamanda
Sravani Alamanda
Updated on 15-Mar-2026 272 Views

No, it does not make sense to use HTML comments on blocks of JavaScript in modern web development. HTML comments within JavaScript were a workaround used in the 1990s to hide JavaScript code from very old browsers that didn't understand the tag. Since all modern browsers support JavaScript, this practice is obsolete and not recommended. Historical Context: Why HTML Comments Were Used In the early days of JavaScript (1995), browsers like Netscape 1 didn't support the tag. Without HTML comments, these browsers would display JavaScript code as plain text on the webpage. The HTML comment syntax ...

Read More

How to fill columns with JavaScript?

Abhishek
Abhishek
Updated on 15-Mar-2026 797 Views

In this tutorial, we will learn how to fill columns with JavaScript using the columnFill property. This CSS property controls how content is distributed across multiple columns - either sequentially (auto) or with equal distribution (balance). The columnFill property specifies how columns should be filled when using CSS multi-column layout. It works in conjunction with columnCount to create responsive column layouts. Syntax Following is the syntax to set the columnFill property in JavaScript: selectedElement.style.columnFill = "value"; Here selectedElement is the DOM element you want to modify. The style property allows you to set ...

Read More

How to set the gap between the columns with JavaScript?

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

In this tutorial, we will learn how to set the gap between the columns with JavaScript. The readability of lengthy paragraphs or articles is improved by dividing them into multiple columns. The text is divided into multiple columns using the 'column-count' CSS property. There needs to be a space or gap between the columns to make each column separate from the other. To set the gap between the columns with JavaScript, we have multiple ways, and in this tutorial, we will discuss two of them − Using the style.columnGap property ...

Read More

How to set the column rule properties with JavaScript?

Samual Sam
Samual Sam
Updated on 15-Mar-2026 250 Views

The columnRule property in JavaScript allows you to set visual separators between multi-column layouts. It controls the style, width, and color of lines that appear between columns. Syntax element.style.columnRule = "width style color"; Parameters width - Thickness of the rule (e.g., "2px", "thin", "medium") style - Line style (solid, dashed, dotted, outset, inset, etc.) color - Rule color (any valid CSS color) Example Click the button to create columns with a visual separator between them: ...

Read More

How to set the style of the rule between columns with JavaScript?

Fendadis John
Fendadis John
Updated on 15-Mar-2026 176 Views

Use the columnRuleStyle property to set the style of the rule between columns in JavaScript. This property controls the visual appearance of the line that separates columns in multi-column layouts. Syntax element.style.columnRuleStyle = "value"; Available Values The columnRuleStyle property accepts the following values: none - No rule (default) solid - A single solid line dotted - A series of dots dashed - A series of dashes double - Two solid lines ...

Read More

How to define the number of nodes in a node list with JavaScript HTML DOM?

Prince Varshney
Prince Varshney
Updated on 15-Mar-2026 678 Views

In this tutorial, we are going to learn how can we find the number of nodes present in a node list in JavaScript. To perform the specific operation, we need to use the HTML DOM which helps us to work with the object model of the webpage. Now let us first understand what a node is and what is a node list in HTML. Everything in an HTML document including element, text, attribute as well as the whole document is a node. Every small element present in an HTML document is part of the navigation tree of an HTML ...

Read More

How to set fontStyle, fontVariant, fontWeight, fontSize, lineHeight, and fontFamily in one declaration with JavaScript?

Sharon Christine
Sharon Christine
Updated on 15-Mar-2026 164 Views

To set all the font properties in a single declaration, use the JavaScript font property. This shorthand property combines fontStyle, fontVariant, fontWeight, fontSize, lineHeight, and fontFamily into one statement. Syntax element.style.font = "fontStyle fontVariant fontWeight fontSize/lineHeight fontFamily"; Font Property Components The font property accepts values in a specific order: fontStyle: normal | italic | oblique fontVariant: normal | small-caps fontWeight: normal | bold | lighter | bolder | 100-900 fontSize: Required value (px, em, %, etc.) lineHeight: Optional, follows fontSize with "/" separator fontFamily: Required font name(s) Example ...

Read More
Showing 3681–3690 of 8,010 articles
« Prev 1 367 368 369 370 371 801 Next »
Advertisements