Found 8894 Articles for Front End Technology

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

Shubham Vora
Updated on 12-Oct-2022 10:55:35

135 Views

In this tutorial, we will learn to set a style of the right border with JavaScript. To set the style of the right border in JavaScript, use the borderRightStyle property. Set the style of the right border using this property. We can apply borders to an element from any side or all sides. We can customize that border on any side. Every edge of a border has a specific property that can use only for that edge. We can provide three parameters like style, color, and width for creating a border. CSS is used to do such tasks. But, we ... Read More

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

Shubham Vora
Updated on 12-Oct-2022 10:59:48

223 Views

In this tutorial, we shall learn to set the style of the top border with JavaScript. To set the style of the top border in JavaScript, use the borderTopStyle property. Set the style of the top border using this property. Let us discuss the property available in JavaScript to achieve this in brief. Using the borderTopStyle Property With the Style borderTopStyle property, we can set or return the style of the top border of an element. Syntax Following is the syntax to set the style of the top border using the borderTopStyle property in JavaScript − object.style.borderTopStyle = value; ... Read More

How -Infinity is converted to String in JavaScript?

Sravani Alamanda
Updated on 08-Dec-2022 09:47:04

141 Views

We all know that string is one of the primitive data types in JavaScript. JavaScript allows us to do some operations on strings like finding characters in the string, changing all characters into lowercase or into uppercase, concatenating with other strings, replacing with other strings, searching character(s) or word(s) from string, etc. We denote string in single quotations or in double quotations. typeof string variable will be a string. Syntax Syntax for String() method is, like String(value) value is required. value is JavaScript value. String() method returns a value i.e. as a string. String() method introduced ... Read More

How is NaN converted to Boolean in JavaScript?

Saurabh Jaiswal
Updated on 11-Aug-2022 14:36:05

1K+ Views

In this article, we will learn how to convert NaN to Boolean. NaN in JavaScript means Not a Number, whose type is a Number but actually, it is not a number. To Convert, the NaN to a Boolean we use Multiple methods some of which are discussed below. Using the Boolean() Function Using the !! Operator Using the NOT Operator and isNaN() Method Using the Boolean() Function The Boolean function is used to get the Boolean value (True or False) of any variable, condition, or object. To convert the NaN into Boolean we just need to pass the ... Read More

How null is converted to Boolean in JavaScript?

Saurabh Jaiswal
Updated on 11-Aug-2022 12:28:54

5K+ 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 the Boolean function Using the !! operator Using the Boolean function The Boolean function is used to get the Boolean value (true or false) of any variable, condition, or object. To convert the null into Boolean we just need to pass the null in the Boolean function. Syntax Boolean(null) Example 1 In this example, ... Read More

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

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

153 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

16K+ 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

351 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

1K+ 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

8K+ 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

Advertisements