Shubham Vora

Shubham Vora

793 Articles Published

Articles by Shubham Vora

Page 28 of 80

How to set the size of the background image with JavaScript?

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

In this tutorial, we will look at the method to set the size of a background image with JavaScript. Background effects on a webpage enhance its look. We can set a background color or a background image to enhance the feel of the webpage. We can also change the background properties, like its size or color. To enhance the feel, the image must fit in the right position with the right size. Generally, we do this by using CSS, but JavaScript DOM also provides properties to do so. So, let us look at how to set the ...

Read More

How to invoke a JavaScript Function with 'new' Function Constructor?

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

In this tutorial, we will learn how to invoke a JavaScript Function with the 'new' Function Constructor. Functions are a set of reusable codes that perform a specific task and may return a value. In JavaScript, functions are defined by the keyword function. A function may not have any parameters and may also not have any return statement. In JavaScript, we also have functions with no function names, called anonymous functions. Using the 'new' Function Constructor The Function constructor makes a new Function object. By using the constructor, we can create a function dynamically. It takes parameters, ...

Read More

Set whether the table border should be collapsed into a single border or not with JavaScript?

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

In this tutorial, let us look at how to set whether the table border should collapse into a single table border or not with JavaScript. We can use the borderCollapse property in JavaScript to accomplish this. This property controls how table borders are displayed - either as separate borders for each cell or collapsed into a single unified border. Using the Style borderCollapse Property The borderCollapse property defines whether the table border should collapse into a single table border or separate into a double table border. The value 'separate' is the default. The borderCollapse is a read-and-write ...

Read More

How to check whether a value is a safe integer or not in JavaScript?

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

In this tutorial, we will learn to check whether a value is a safe integer or not in JavaScript. A safe integer in JavaScript is any number that can be accurately represented under the IEEE-754 double-precision format. Safe integers are all numbers between -(2^53 - 1) and (2^53 - 1) inclusive. JavaScript provides a built-in method for this check, but we can also implement custom logic. Here are the approaches we'll explore: Using the Number.isSafeInteger() Method (Recommended) Using Custom if-else Logic Using Number.isSafeInteger() Method The Number.isSafeInteger() ...

Read More

How to set the width of the bottom border with JavaScript?

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

In this tutorial, we shall learn to set the width of the bottom border with JavaScript. To set the width of the bottom border, we can use the borderBottomWidth property in JavaScript. It allows you to change the width. Let us discuss our topic in brief. Using the borderBottomWidth Property With this property, we can set or return the width of an element's bottom border. Width is a floating point number with either a relative units designator (cm, mm, in, pt, or pc) or an absolute units designator (em, ex, or px). Syntax Following is ...

Read More

How to convert Unicode values to characters in JavaScript?

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

In this tutorial, we will learn to convert Unicode values to characters in JavaScript. The Unicode values are the standard values for the character, and users can encode them to convert them into characters. For example, 'A' is a Unicode character whose value is 65 according to the ASCII (American standard code for information interchange) table. In the same way, all alphabets, numbers, and other characters have particular Unicode values. We will learn to identify the Unicode character from its values using JavaScript. Using the fromCharCode() Method In JavaScript, the String object contains the fromCharCode() method, which ...

Read More

How to set the color of an elements border with JavaScript?

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

In this tutorial, we will learn how to set the color of an element's border with JavaScript. The border is the outline of an HTML element. The border can be styled differently with different types of border properties. To set the color of the border of an element with JavaScript, we have the style borderColor property. Using the Style borderColor Property In JavaScript, the style borderColor property of an element is used to set the color of the border of an element. To set the color of the border of an element, we first need to get ...

Read More

How to set the type of positioning method used for an element with JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 373 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. Understanding CSS Position Types Before diving into JavaScript implementation, let's understand the available position values: static − The default position. Elements follow normal document flow. relative − Positioned relative to its normal position without affecting other elements. absolute − Positioned ...

Read More

How to set the right position of a positioned element with JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 3K+ 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 CSS 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. Using the right Property With this ...

Read More

How to set the painting area of the background with JavaScript?

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

In this tutorial, we will learn how to set the painting area of the background with JavaScript using the backgroundClip property. The background-clip CSS property defines how far a background (color or image) extends within an element. It specifies whether the background extends beneath the border-box, padding-box, or content-box of an element. Understanding background-clip Property The background-clip property accepts three main values: border-box - Background extends to the outer edge of the border (default) padding-box - Background extends to the outer edge of the padding content-box ...

Read More
Showing 271–280 of 793 articles
« Prev 1 26 27 28 29 30 80 Next »
Advertisements