Found 9054 Articles for Front End Technology

How to get the hash part of the href attribute of an area in JavaScript?

Shubham Vora
Updated on 14-Sep-2022 13:28:28

477 Views

In this tutorial, we will learn how to get the hash part of the href attribute of an area in JavaScript. The HTML element establishes an area within an image map with predetermined clickable zones. An image map allows you to correlate geometric regions of a picture with hypertext links. This element can only be used within the < map> element. The href property gives the area's hyperlink target. The element is not a hyperlink if the href attribute is not present. Following is a method used to get the href attribute’s hash part of an area in ... Read More

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

Shubham Vora
Updated on 09-Nov-2022 10:58:37

199 Views

In this tutorial, we will learn how to set the width of the left border with JavaScript. The border property specifies the boundary of an element. It specifies the border style, border-color values, and also border-width. One, two, or three of the values can be used to specify the border attribute. The sequence of the values is irrelevant. The border shorthand comes in handy when you want all four borders to be the same. To differentiate them, employ the longhand border-color, and other attributes like border style and width, which take distinct values for each side. Alternatively, you may use ... Read More

How Is Infinity converted to String in JavaScript?

Shubham Vora
Updated on 02-Aug-2022 09:52:54

387 Views

This tutorial will teach us how to convert the infinity to string in JavaScript. The Infinity is the reserved keyword in JavaScript and demonstrates the concept of the infinity number of mathematics. It is a global variable, and we can access it anywhere in our program. Here, we have two approaches to converting the infinity number to a string in JavaScript. Using the String() Constructor Using the toString() Method Using the String() Constructor The JavaScript contains the class for the variable of every data type and its related method. It also contains the string class and which is ... Read More

How to get the port number part of the href attribute of an area in JavaScript?

Shubham Vora
Updated on 14-Sep-2022 08:26:37

251 Views

In this tutorial, we will discover how to get the port number of the href attribute of an area in JavaScript. An area is a tag in JavaScript. This tag is written as . This tag denotes an area inside an image map. This tag has no closing tag. So in HTML, this is an empty tag. In XHTML, this tag must be closed correctly. An image map is also another tag. This tag is written as . An image map contains an image with clickable or active areas. The area tag comes inside the map tag. This tag ... Read More

How Is Infinity converted to Boolean in JavaScript?

Shubham Vora
Updated on 17-Aug-2022 08:01:52

260 Views

A number representing positive infinity is called infinity. -Infinity stands for the opposite of infinity. When a number exceeds its maximum value, it enters infinity: 1.797693134862315E+308. When an integer crosses its lower bound, it enters infinity: -1.797693134862316E+308. The universal object has the quality of infinity and is a variable with a global scope, in other words. The number is the beginning value of Infinity. A Boolean value in JavaScript may either be true or false. Users can use the Boolean function to know if something is "true" or "false". Booleans can be kept track of and modified over time by ... Read More

How to find the coordinates of the cursor relative to the screen with JavaScript?

Abhishek
Updated on 31-Oct-2022 07:53:23

4K+ Views

In this tutorial, we will learn how we can get the coordinates of the mouse cursor relative to the screen with JavaScript. We will find the position of the cursor vertically (Y-axis) and Horizontally (X-axis) relative to the screen. JavaScript allows us to use two different properties to get the coordinates of the mouse cursor relative to the screen when the mouse button is pressed anywhere on the screen − Using the event.screenX Property Using the event.screenY Property Let us discuss both of them one by one with code examples. Using the event.screenX Property The event.screenX property is ... Read More

How to find the coordinates of the cursor with JavaScript?

Abhishek
Updated on 31-Oct-2022 11:19:49

13K+ Views

In this tutorial, we will learn how we can find the coordinates of the mouse cursor with JavaScript. We have to find out the X and Y-coordinates or we can say that the horizontal and the vertical position of the cursor on the screen with JavaScript. JavaScript provides us with two different properties to get the coordinates of the mouse cursor when the mouse button is pressed anywhere on the screen − Using event.clientX Property Using event.clientY Property Using event.clientX Property The event.clientX property is used to find out the value of the horizontal position or the X-coordinate ... Read More

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

Shubham Vora
Updated on 12-Oct-2022 11:13:56

151 Views

This tutorial will teach us to set the width of the right border with JavaScript. To set the width of the right border, use the borderRightWidth property. Set the width of the right border using this property. We can also apply the borderWidth to set the right border. Borders are used on various elements on a webpage. They display the boundaries of an element. We can apply the borders to all sides of an element. There are different properties to set different sides of a border. For a static border, generally, CSS is used. But to change it dynamically, JavaScript ... Read More

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

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

123 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

203 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

Advertisements