In this article we are going to discuss how to find the number of links in a document in JavaScript. The DOM property in the JavaScript provides many properties like , , , , , . There are two ways through which we can represent the links in HTML DOM. The DOM object provides links property. The document.links property provides us a collection of and tags inside a document. The document.links property is similar to an array. We can access any property (like href, name, title) of the links using this property. To find the total number of ... Read More
In this article we will learn how to get a particular anchor in a document in JavaScript. The Javascript anchor tags follow an array-like structure. When we try to display a particular anchor tag we have to use ,document.anchors.innerHTML method. This method works the same as array methods which are used to display a particular element. To get a better understanding let’s look into the usage and syntax of anchor tag in JavaScript. Syntax The syntax to get a particular anchor tag is shown below. document.anchors[i].innerHTML or document.getElementsByTagName(“a”)[i].innerHTML Example 1 The following is an example program to get a ... Read More
This article discusses about how to find the number of anchors in a document in JavaScript. The anchor tag is a part of HTML DOM elements. The anchor property is a read only property that returns a list of anchor tags inside a document. The anchor object is represented as . There are two ways to get the length of the anchors object. One way is to use the anchors.length property that returns the number of anchor tags in a document. The other way is to use getElementByTagName method to access the anchor tag and use the length property. Both ... Read More
In this article we will learn how to get the title and full URL of a document in JavaScript with the help of examples. The Javascript HTML DOM has provided some basic methods to access and manipulate the HTML data. To find the title and URL of a document, JavaScript has provided document.title and document.URL respectively. The document.title property − The document.title property returns the current title of the document. This property applies to HTML, SVG, XUL, and other documents. The syntax to get the title of the document is shown below. document.title The document.url property − The URL ... Read More
In this article we are going to discuss how to know the browser language and browser platform with the help of examples in JavaScript To know the various properties of the browser, the JavaScript provides Navigator object. The Navigator object has several properties, which include - connection, credentials, cookies, geolocation, language, platform, etc. We are concerned with Navigator.language and Navigator.platform to know the language and platform of the browser. Let us discuss about them in detail. Navigator.language The read-only Navigator.language property returns a string that represents the browser UI language. It returns a string that returns the language version. For ... Read More
In this article we are going to discuss the use of Higher-order functions in JavaScript. A higher order function is simply, a function that accepts other functions as parameters and/or returns a function. To know about Higher-order functions, we should learn about call back functions. A call back function is a function that is passed to another function as an argument. With the help of call back functions, one function can call another function and the call back function runs only after other function has finished. Some of the higher-order functions are map, reduce and filter. In order to understand ... Read More
This article discusses about how do you test if a value is equal to NaN in JavaScript. In JavaScript, NaN is a method from Number class. NaN implies Not-a-Number. It is of Boolean type. It returns true when the value is “Not-a-number”. The NaN method is used in the situations. For example, when a function tries to parse a number and it fails or when a math function fails, the method NaN is used. The syntax for isNaN() method is shown below. isNaN(); or Number.isNaN(); There is a difference between isNaN() and Number.isNaN(). If the value is currently NaN ... Read More
In this article, we are going to discuss about the quickest language between JavaScript and ASP script. JavaScript is a light weighted and compiled language. It is a popular client-side scripting language. The content of JavaScript code is visible to the users. The extension for a JavaScript file is .js. Active Server Pages Script is popularly known as ASP script. It is a server-side scripting language to develop dynamic web pages. The extension for an ASP script file is .asp. Consider a Three-tier architecture – Presentation layer, Application layer and Data layer. JavaScript is used in the presentation layer. JavaScript ... Read More
In this article we are going to learn how to find the inner height and inner width of a browser window using JavaScript. JavaScript defines window object methods and properties. The properties include inner height and inner width, which helps us to calculate the height and width of a window’s content area. There are two ways to calculate the inner height and inner width of a window. Using innerHeight and innerWidth properties − To get the inner height and inner width JavaScript has provided some properties such as window.innerHeight and window.innerwidth respectively. Using these properties, it is easy to ... Read More
In this tutorial, we're going to learn how to set up a poster image for a video player created using video.js. Video.js is a very popular and well-known open-source HTML video player framework. It supports a lot of video formats, from standard video formats like mp4, WebM, Flv, etc to other modern video playback formats like YouTube, Vimeo, twitch, etc. Video.js is so widely accepted because of the flexibility, customizations, and support it provides while creating a video player. For the purpose of this tutorial, we're going to change the look of our video player by adding a poster image ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP