Found 8894 Articles for Front End Technology

How to show name/value pairs of cookies in a document with JavaScript?

Abhishek Kumar
Updated on 21-Sep-2022 07:34:32

671 Views

We use the cookie property of the document object to show the name/value pairs of cookies in a document with JavaScript. The document object, part of the DOM, corresponds to the current web page that the browser has loaded. It Contains all the information about the condition of the browser as well as the web page. A server serves requests when a connection is set up and forgets everything about the user as soon as the connection is closed. This posed a nasty problem of bad user experience to the community. A cookie, resolves this problem by storing small but ... Read More

How to show the domain name of the server that loaded the document with JavaScript?

Abhishek Kumar
Updated on 21-Sep-2022 07:40:55

2K+ Views

We use the window.location.hostname property of the document object to show the domain name of the server that loaded the document using JavaScript. The document object, part of the DOM, corresponds to the current web page that the browser has loaded. It Contains all the information about the condition of the browser as well as the web page. Every resource or computer that is available on the internet has an address that is either IPV4 (192.88.99.255) or IPV6 (2001:db8:3333:4444:5555:6666:7777:8888). These addresses are good for computers but not for us. domain name system is a layer of abstraction over that organization ... Read More

How to find the number of anchors with JavaScript?

Abhishek
Updated on 31-Oct-2022 08:03:31

140 Views

In this tutorial, we will learn how to find the number of anchors used in an HTML document with JavaScript. Sometimes, During the development of a web page, the developer may need to add multiple links to the different buttons present on the webpage using multiple anchors for each button. In such a situation, if you want to find the number of anchor elements, you can use the anchors property. JavaScript allows us to use the anchors property to count the number of anchors ( elements) in an HTML document. Note − The document.anchors property is deprecated and no longer ... Read More

How to show the number of links in a document with JavaScript?

Abhishek Kumar
Updated on 21-Sep-2022 07:58:03

560 Views

We use the links property of the document object to show the number of links in a document with JavaScript. The document object, part of the DOM, corresponds to the current web page that the browser has loaded. It Contains all the information about the condition of the browser as well as the web page. The links is a property of the document object that returns a list of all the hyperlinks present in the HTML document. A hyperlink may look something like this − "https://www.tutorialpoints.com/php" The links property of the document object lists all HTML elements having href ... Read More

How to get the number of forms in a document with JavaScript?

Shubham Vora
Updated on 14-Sep-2022 08:47:27

899 Views

In this tutorial, we will learn how to get the number of forms in a document using JavaScript. Since different methods are used to create forms in an HTML document, it might get tricky to get the number of forms present. However, you can use some methods to count the forms created without the form tag. Using the length Property The most widely accepted method to create forms in HTML documents is using the tag. Some websites also use tags to create forms in the document. Hence, we will discuss the method to get the number of forms ... Read More

How to load the previous URL in the history list in JavaScript?

Shubham Vora
Updated on 14-Sep-2022 13:33:47

6K+ Views

In this tutorial, we will learn to load the previous page in the history list in JavaScript. The Window object in JavaScript accesses the window in the browser. This object contains many properties and methods required to do the tasks. The Window object also retrieves the information from the browser window. There is a history stack in every browser that saves the pages visited by the user. To access this history stack, we can use the history object that is the property of the Window object. By accessing the history from the browser, we can go to the next or ... Read More

How to load the next URL in the history list in JavaScript?

Shubham Vora
Updated on 14-Sep-2022 13:31:40

606 Views

In this tutorial, we will learn to load the next page in the history list in JavaScript. The Window object in JavaScript accesses the window in the browser. This object contains many properties and methods required to do the tasks. The Window object also retrieves the information from the browser window. There is a history stack in every browser that saves the pages visited by the user. To access this history stack, we can use the history object that is the property of the Window object. By accessing the history from the browser, we can go to the next or ... Read More

For the Hosts Locale how to convert a string to uppercase letters in JavaScript?

Shubham Vora
Updated on 15-Nov-2022 08:08:31

195 Views

In this tutorial, we will learn how to convert a string to uppercase letters for the host's locale in JavaScript. While using a locale language to write for a website, we might have to convert the sentence from lowercase to uppercase without changing the structure of the string. Using the toLocaleUpperCase() Method In JavaScript, we use the toUpperCase() Method as well as the toLocaleUpperCase() to change the letters of a string to uppercase. Although both methods give similar output the toLocaleUpperCase() is used primarily for local languages. Syntax We will use the following syntax to convert the letters of the ... Read More

Find a form feed character with JavaScript RegExp.

Sravani Alamanda
Updated on 26-Aug-2022 12:52:29

870 Views

Form feed character is page breaking ASCII control character. It is commonly used for page separators. When you want to insert a page break, the text editor can use this form feed. It is defined as \f and has an ASCII code value as 12 or 0x0c. RegExp is an object that specifies the pattern used to do a search and replace operations on a string or for input validation. RegExp was introduced in ES1, and it is fully supported by all browsers. Now, we will check how to find the form feed (\f) character in the given text using ... Read More

Find a new line character with JavaScript RegExp.

Sravani Alamanda
Updated on 26-Aug-2022 12:55:22

3K+ Views

The new line character, we denote as . This is used to make a line break. ASCII code for is 10 and it is also called Line Feed (LF). Now, let's see how to find a new line character using RegExp. A RegExp is an object that specifies the pattern used to do search and replace operations on the string or for input validation. RegExp was introduced in ES1 and it is fully supported by all browsers The RegExp meta character finds an index value of the first occurrence of a newline character in a given text. Syntax ... Read More

Advertisements