Found 8894 Articles for Front End Technology

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

113 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 return pixel depth of the screen in JavaScript?

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

313 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

131 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

How to work with document.links in JavaScript?

Shubham Vora
Updated on 15-Nov-2022 10:26:59

721 Views

In this tutorial, let us discuss how to work with the document's link in JavaScript. The document link property is a read-only DOM level 1 feature that returns all the links. The links property gives all the anchor elements and area tags with a href attribute. Working with document.links properties Let us learn to work with a link's properties. Users can follow the syntax below to work with the link's properties. Syntax let links = document.links; links.propertyName; The above syntax returns all anchor tags, area tags, and properties. Properties length − The length is the number of elements ... Read More

What are the properties of window.screen object in JavaScript?

Shubham Vora
Updated on 31-Oct-2022 11:16:00

392 Views

In this tutorial, we will discuss the properties of the window.screen object in JavaScript. The window comes under the Browser Object Model – BOM. The window's screen object holds information on the user's screen. Because the scope of the window object is high, we can also write the window's screen object as "screen". There are no direct methods for the screen object. The object's use is to improve the UI experience of a webpage. Properties of window.screen Object availHeight The availHeight property returns the screen height, excluding the Windows Taskbar. availWidth The availWidth property returns the screen width, excluding the ... Read More

How to return the protocol (http or https) of the web page with JavaScript?

Prabhdeep Singh
Updated on 07-Nov-2022 08:02:14

790 Views

In this tutorial, we will look at how to find which protocol is being used by a web page. A web page mostly uses http or https protocol. A protocol is a type of standard which is used to specify, how the data is transferred or transmitted between different sets of computer. HTTP − HTTP is a protocol for retrieving resources such as HTML pages. It is one of the most essential and the backbone for all types of data exchange that happens over the internet. HTTP is a client server protocol which means that all the requests are done ... Read More

How to work with document.forms in JavaScript?

Shubham Vora
Updated on 31-Oct-2022 11:11:45

3K+ Views

In this tutorial, let us discuss how to work with document.forms in JavaScript. The document.form property returns all the form tags in the document. The forms property is read-only. The form property is the Dom level 1 feature. Working with form attributes and elements Here let us learn to work with a form's properties, attributes, and elements. Users can follow the syntax below to work with the form's properties and elements. Syntax var forms = document.forms; let formLen = forms.length; let formId = forms[0].id || forms.item(0).id; let formItemId = forms[0].elements[0].id; let formItemVal = forms[0].elements[0].value; let formData = forms.namedItem("testForm").innerHTML; The ... Read More

How to work with document.head in JavaScript?

Shubham Vora
Updated on 15-Nov-2022 09:14:52

1K+ Views

In this tutorial, let us discuss how to work with the document's head in JavaScript. The document head property is a dom level 3 read-only feature. The document's head property returns all the head tags in the document. HTML adds an empty head tag in case it is not present. The property returns the first head element in case there are many. The head tag contains the document header information like title, keywords, description, and style sheet. Every document needs a head tag. But start and end tags are optional. The first body tag or the first frameset tag becomes ... Read More

How to work with document.documentElement in JavaScript?

Shubham Vora
Updated on 31-Oct-2022 11:08:45

3K+ Views

In this tutorial, we will learn to work with document.documentElement property in JavaScript. JavaScript DOM is a JavaScript script that can dynamically read or change the webpage's content. There are numerous properties available in the JavaScript DOM. We can access, change and style every element on the webpage. The document is the property of dom that is the root of the HTML webpage. It again consists of its child properties. The documentElement is the child property of the document property in dom. It is used to get the root element of the document. It returns an object consisting of the ... Read More

How to work with document.body in JavaScript?

Shubham Vora
Updated on 31-Oct-2022 11:53:23

8K+ Views

In this tutorial, we will learn how to work with document.body in JavaScript. Use the document.body property in JavaScript to get the body of the document, i.e., tag. The tag defines the body of the document. The entire content of an HTML document, including all headings, paragraphs, images, hyperlinks, tables, lists, and other elements, is contained in the element. In an HTML document, there can only be one element. In this tutorial, we will work with the document.body in JavaScript for − Change the background color of the body Add a new element at the ... Read More

Advertisements