Found 10483 Articles for Web Development

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

Monica Mona
Updated on 23-Jun-2020 12:18:22

111 Views

Use the columnRuleWidth property to set the width between columns. You can try to run the following code to set the width of the rule between columns with JavaScript −ExampleLive Demo                    #myID {             column-count: 4;             column-rule: 4px solid yellow;          }                     Click below to change width       Change Width between Columns                This is ... Read More

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

Sharon Christine
Updated on 23-Jun-2020 12:08:47

122 Views

To set all the font properties, use the JavaScript font property. You can try to run the following code to set all font properties in a single declaration with JavaScript −ExampleLive Demo           Heading 1                This is Demo Text. This is Demo Text. This is Demo Text. This is Demo Text.          This is Demo Text. This is Demo Text. This is Demo Text. This is Demo Text.             Set Font                function display() {             document.getElementById("myID").style.font = "italic 15px verdana,sans-serif";          }          

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

Prince Varshney
Updated on 06-Dec-2022 09:21:12

506 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 DOM. ... Read More

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

Fendadis John
Updated on 23-Jun-2020 12:19:00

127 Views

Use the columnRuleStyle property to set the style of the rule. You can try to run the following code to set the style of the rule between columns with JavaScript −ExampleLive Demo                    #myID {             column-count: 4;             column-rule: 4px dotted yellow;          }                     Click below to change style       Change Style between Columns                This ... Read More

How to set the column rule properties with JavaScript?

Samual Sam
Updated on 23-Jun-2020 12:10:04

203 Views

The columnRule property is used in JavaScript to set the column rule. It allows you to set the style, color, and width between column rule.ExampleYou can try to run the following code to set the column rule properties with JavaScript −Live Demo           Click below to create 4 columns       Columns                This is demo text. This is demo text. This is demo text. This is demo text.          This is demo text. This is demo text. This is demo text. This is ... Read More

How to set the gap between the columns with JavaScript?

Shubham Vora
Updated on 11-Nov-2022 13:08:42

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 Using the style.setProperty() method Using the style.columnGap Property ... Read More

How to fill columns with JavaScript?

Abhishek
Updated on 31-Oct-2022 11:16:52

705 Views

In this tutorial, we will learn how we can fill columns with JavaScript. Use the columnFill property to fill columns. Fill it as auto to fill sequentially, or balance to equally divide content between columns. The columnFill property is the property that specifies how the columns should be filled, auto, balanced, or in any other manner. Syntax Following is the syntax to set the columnFill property in JavaScript − selectedElement.style.columnFill="value"; Here the selectedElement is the element to which you want to add the columnFill property, while using style is the way of adding any CSS property to an element ... Read More

How to detect a mobile device with JavaScript?

Prince Varshney
Updated on 02-Sep-2023 12:54:48

69K+ Views

In this tutorial, we are going to learn how can we detect a mobile device over which we are working using JavaScript. Approach 1: Using the navigator.userAgent Property To detect a mobile device with JavaScript we are going to use the window navigator object which contains all the information regarding a browser. The property which we will use to detect a mobile device will be the userAgent property which is used to return the user-agent header sent to the server by the browser. The value we receive from this property is the browser name, version, and platform i.e., all the ... Read More

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

Sravani Alamanda
Updated on 26-Aug-2022 14:41:42

179 Views

No, it is not recommended to use HTML comments to comment blocks of code. When JavaScript has first released some browsers didn’t have any support to understand the script. So a technique was then needed to hide the script code for older browsers. So that time the HTML comment within the JavaScript block was used to prevent the older browsers from showing the script code as text on the page. This technique was followed in the 1990s. Such browsers do not exist now, which wanted you to use HTML comments in JavaScript. Now all browsers understand the JavaScript blocks, so ... Read More

How to set the font family for text with JavaScript?

Shubham Vora
Updated on 11-Nov-2022 13:00:41

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 family names and/or generic family names for the text. The ... Read More

Advertisements