Found 10483 Articles for Web Development

How to set the inward offsets of the image border with JavaScript?

Shubham Vora
Updated on 15-Nov-2022 08:02:29

236 Views

In this tutorial, we will learn how to set the inward offsets of the image border with JavaScript. An image can be set in the border as a border image using CSS properties. The border image can be set using different parameters. To set the inward offsets of the image border, use the borderImageSlice property in JavaScript. We will see two different approaches to setting up the inward offsets of the image border with JavaScript − The borderImageSlice Property The setProperty Method Using the borderImageSlice Property The border image’s inward offsets are specified by the borderImageSlice property of ... Read More

How null is converted to String in JavaScript?

Saurabh Jaiswal
Updated on 11-Aug-2022 12:47:31

21K+ Views

In JavaScript null is a predefined keyword that represents an empty value or unknown value of no value. The data type of null is an object. In this article, we will learn how to convert null into String using multiple approaches which are following. Using the String() Method Concatenating null with an Empty string Using the Logical OR (||) Using Ternary Operator Using the String() Method The String() in JavaScript is used to convert a value to a String. To convert the null into a String just pass the null into this method. Here is the example ... Read More

How to return the position of the element relative to floating objects in JavaScript?

Prabhdeep Singh
Updated on 07-Nov-2022 07:32:28

469 Views

This tutorial teaches us how to return the position of the element relative to floating objects in JavaScript. To set the relative position or to get or return the relative position we are going to use the ‘clear’ property of JavaScript which is defined under the style property of an object. There are a total of four relative positions that are ‘left’, ‘right’, ‘top’, and ‘bottom’, and if we relatively position an object then it will fill all the gaps of that particular side. The float property of the JavaScript language can be used to set the property of the ... Read More

How to attach one or more drop-shadows to the box with JavaScript?

Saurabh Jaiswal
Updated on 06-Jan-2023 13:26:42

2K+ Views

To attach one or more drop shadows to a box with JavaScript, you can use the box-shadow style property. You can specify the shadow's offset, blur radius, spread radius, and color by passing values for these properties in the box-shadow property. Syntax Following is the syntax to add one or more drop shadows to the box with JavaScript − box.style.boxShadow = "offset-x offset-y blur-radius spread-radius color"; Here the box.style.boxShadow property in JavaScript allows you to add one or more drop shadows to a box element. It takes the following parameters offset-x − This is the horizontal offset of ... Read More

How null is converted to Number in JavaScript?

Saurabh Jaiswal
Updated on 11-Aug-2022 12:38:34

10K+ Views

In JavaScript null is a predefined keyword that represents an empty value or unknown value of no value. The data type of null is an object. In this article, we will learn how to convert null into Boolean using multiple approaches which are following. Using Number() Method Using Logical OR (||) Using the ~~ operator Using Ternary Operator Concatenating null with a boolean value Using the Number() Method The Number() method in JavaScript is used to convert a value into a number. If the value is not convertible, then it will return NaN. To convert the null into ... Read More

How to set the amount by which the border image area extends beyond the border box with JavaScript?

Shubham Vora
Updated on 12-Oct-2022 11:29:02

175 Views

In this tutorial, we will learn how to set a number up by which the border image area extends beyond the border box in JavaScript. To set the amount by which the border image is extended, you need to set the border outside edges. To do this we can apply the borderImageOutset style property provided in JavaScript. After creating a border image area for the HTML element, we might have to increase the area. By knowing a method to increase the border image area more than the border box, we can make the change without writing lengthy code. ... Read More

How to set the widths of the image border with JavaScript?

Shubham Vora
Updated on 25-Oct-2022 10:23:45

474 Views

In this tutorial, we shall learn to set the widths of the image border with JavaScript. To set the widths of the image border, use the borderImageWidth property in JavaScript. When we need an image as a border of our webpage content, we have to see how to set the width of the image border. Let us discuss the option to achieve this in brief. Using the Style borderImageWidth Property With the Style borderImageWidth property, we can set or return the widths of the image border of an element. The border image will range beyond the padding when the border ... Read More

How to change the value of an attribute in javascript?

Shubham Vora
Updated on 08-Aug-2022 08:36:09

23K+ Views

In this tutorial, we will learn to change the value of an attribute in JavaScript. To build web applications, the most programmer uses three languages. HTML, CSS, and JavaScript. The HTML is used to create the base for the web page, CSS for styling, and JavaScript adds the dynamic behaviours to the web page. Users have seen on many websites that it changes the element's style when they just click on the button. We can make it happen using JavaScript. Using JavaScript, let’s look at setting the new attribute for the HTML element or changing the attribute values dynamically. To ... Read More

How to return pixel depth of the screen in JavaScript?

Prabhdeep Singh
Updated on 07-Nov-2022 07:15:10

421 Views

In this tutorial, we will discuss how we can return the pixel depth of the screen in JavaScript. There is a property in JavaScript name pixel depth with the help of this property we can quickly return the pixel depth of the screen’s color. This pixel depth property returns the screen’s color depth in bits per pixel, and this property is read-only means (A property's value can be accessed, but it cannot be given a value. or we could state that it cannot be assigned to or overwritten). Basically, we are returning how many bits are used to store a ... Read More

How to return a number of bits used to display one color on a window screen in JavaScript?

Prabhdeep Singh
Updated on 07-Nov-2022 06:57:03

229 Views

In this tutorial, we will explore how we can find out the number of bits that are used to display a single color on the screen of our device using JavaScript. JavaScript has many inbuilt functions that allow us to get information about the various properties of the display screen. We’ll be using one such function to accomplish the task mentioned above. As discussed in the previous section, we want to find out the exact number of bits that are used to display a particular color on the user’s display screen by using JavaScript. Before we can access the number ... Read More

Advertisements