Javascript Articles - Page 574 of 671

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

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

367 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

706 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

477 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

497 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 search the alternate text of an image-map area in JavaScript?

Sravani S
Updated on 23-May-2020 11:22:37

169 Views

To search the alternate (alt) text of an image-map area in JavaScript, use the alt property. You can try to run the following code to get the alternate text.Example                                                      var x = document.getElementById("myarea").alt;          document.write("Alternate Text: "+x);          

How to search the value of the type attribute of a link in JavaScript?

Jennifer Nicholas
Updated on 23-May-2020 11:22:09

208 Views

To search the value of the type attribute of a link in JavaScript, use the type property. You can try to run the following code to get the value of type attribute.Example           Qries                var x = document.getElementById("qriesid").type;          document.write("Value of the type attribute: "+x);          

How to search the value of the target attribute of a link in JavaScript?

Nikitha N
Updated on 23-May-2020 11:21:40

354 Views

To search the value of the target attribute of a link in JavaScript, use the target property. You can try to run the following code to get the value of target attribute.Example           Qries                var x = document.getElementById("qriesid").target;          document.write("Value of the target attribute: "+x);          

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

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

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

Which is the event when the browser window is resized in JavaScript?

Nishtha Thakur
Updated on 23-Jun-2020 09:18:50

157 Views

Use window.outerWidth and window.outerHeight event in JavaScript to get the size of windows when the browser is resized.ExampleYou can try to run the following code to work with events to check the browser window size −                    function resizeFunction() {             var val = "Window Width=" + window.outerWidth + ", Window Height="             + window.outerHeight;             document.getElementById("test").innerHTML = val;          }                     Resize browser window and check the window (browser window)       height and width again.          

How to find the coordinates of the cursor with JavaScript?

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

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

Advertisements