Javascript Articles - Page 469 of 534

What will happen when 0 is converted to Number in JavaScript?

karthikeya Boyini
Updated on 23-Jun-2020 09:22:27

133 Views

Use the Number() method in JavaScript to convert to Number. You can try to run the following code to learn how to convert 0 to Number in JavaScript −ExampleLive Demo           Convert 0 to Number                var myVal = 0;          document.write("Number: " + Number(myVal));          

How to search the querystring part of the href attribute of an area in JavaScript?

Ramu Prasad
Updated on 23-Jun-2020 09:23:07

176 Views

To get the querystring of the href attribute of an area, use the search property. You can try to run the following code to search the querystring −Example                                                var x = document.getElementById("myarea").search;          document.write("Querystring: "+x);          

How to set all the background properties in one declaration with JavaScript DOM?

Swarali Sree
Updated on 23-May-2020 11:41:14

157 Views

To set the background in JavaScript, use the background property. It allows you to set the background color, image, position, etc.ExampleYou can try to run the following code to learn how to set all the background properties in a single declaration with JavaScript.Live Demo           Click to Set background                function display() {             document.body.style.background = "url('https://www.tutorialspoint.com/html5/images/html5-mini-logo.jpg') repeat right top";          }          

How to search and display the pathname part of the href attribute of an area with JavaScript?

Vrundesha Joshi
Updated on 23-May-2020 11:37:05

177 Views

To get the pathname part of the href attribute of an area in JavaScript, use the pathname property.ExampleYou can try to run the following code to display the pathname part.                                                var x = document.getElementById("myarea").pathname;          document.write("Pathname: "+x);          

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

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

405 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 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

519 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

581 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

190 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

238 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);          

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

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

179 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.          

Advertisements